I have just received a set of nRF52840 dongles and I want to write applications that run on the PC using the dongle so I have downlaoded the pre-compiled pc-ble-driver located here: https://github.com/NordicSemiconductor/pc-ble-driver/releases/tag/v4.1.1.
I downloaded the zip for the 64-bit version of windows. I assumed that this download would have the connectivity HEX file for the dongle, the libraries I would need to access the dongle's BLE methods, and the h-files. Then I could start a VS 2019 project, link the libraries and the h-files to the project and start writing source code. TO make life easier I get the example heart rate monitor from the pc-ble-driver project on github. It is only one file main.c
Using nRF Connect Desktop tool, I have installed the connectivity_4.1.1_usb_with_s140_6.1.1.hex file onto the dongle. That appears to be the latest version. Everything appears to be fine so far.
I was hoping that the h-files in the directory nrf-ble-driver-4.1.1-win_x86_64\include\sd_api_v6 of the pre-built project would be sufficient; but apparently not. There were several definitions that were not understood. Turns out I have to define the preprocessor variable to set the version as follows #define NRF_SD_BLE_API 6. That solved all those problems. Now the code is ready to build.
I have set the project to use static linking to the libraries assuming that this huge library file nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib would then have all I need. But build the project I get 16 undefined symbols.
1>main.c
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_ble_gap_adv_set_configure referenced in function advertisement_data_set
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_ble_gap_adv_start referenced in function advertising_start
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_ble_gatts_service_add referenced in function services_init
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_ble_gatts_characteristic_add referenced in function characteristic_init
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_ble_gatts_hvx referenced in function heart_rate_measurement_send
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_ble_gatts_sys_attr_set referenced in function ble_evt_dispatch
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_ble_gatts_exchange_mtu_reply referenced in function ble_evt_dispatch
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_ble_enable referenced in function ble_stack_init
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_ble_cfg_set referenced in function ble_cfg_set
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_rpc_physical_layer_create_uart referenced in function adapter_init
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_rpc_data_link_layer_create_bt_three_wire referenced in function adapter_init
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_rpc_transport_layer_create referenced in function adapter_init
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_rpc_adapter_create referenced in function adapter_init
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_rpc_open referenced in function main
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_rpc_close referenced in function main
1>main.obj : error LNK2019: unresolved external symbol __imp_sd_rpc_log_handler_severity_filter_set referenced in function main
1>E:\projects\BleTester\BleHeartRateMonitor\x64\Debug\BleHeartRateMonitor.exe : fatal error LNK1120: 16 unresolved externals
Do I need another library or is this just saying that somehow I have not set up my Visual Studio project properties to find this library (though I can't see any error in the latter). So I guess I am asking is the nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib the only library I need or am I missing a library or is the library incompatible with Visual Studio?