<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Building the examples in pc-ble-driver from scratch</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52871/building-the-examples-in-pc-ble-driver-from-scratch</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 13 Oct 2019 11:34:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52871/building-the-examples-in-pc-ble-driver-from-scratch" /><item><title>RE: Building the examples in pc-ble-driver from scratch</title><link>https://devzone.nordicsemi.com/thread/214693?ContentTypeID=1</link><pubDate>Sun, 13 Oct 2019 11:34:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2e5399c-09c4-4a0e-8733-ba98dcb232ac</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Turns out that it was because you used a cpp (C++) file and the example is in C. Changing the the cpp to c in the file created by the VS Console app solves the problem - for anyone else who stumbles on the same problem. (One of those things you don&amp;#39;t think about when using the VS shell project creators).&lt;/p&gt;
&lt;p&gt;There is another issue that caused my library problems. Even though its a static library I linked to, if I set the project properties CodeGeneration settings to use static linking, the project will not build. I get all kinds of warning conflicts about already imported libraries by the Nordic static library which eventually become warnings. So the only way to build the project is to set the code generation to dynamic (dll) linking.&lt;/p&gt;
&lt;p&gt;Needless to say, I do not understand why that is so.&lt;/p&gt;
&lt;p&gt;But if I do, I can use the property pages to point to the Nordic static library instead of bringing it into my source or lib &amp;#39;filter&amp;#39; folder in my project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building the examples in pc-ble-driver from scratch</title><link>https://devzone.nordicsemi.com/thread/214477?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 23:52:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3a7b48a-3b88-47b5-a0c5-053b8cd830cc</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;I can&amp;#39;t attach files here so I will send it to you in an email&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building the examples in pc-ble-driver from scratch</title><link>https://devzone.nordicsemi.com/thread/214474?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 21:57:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7f8e53f-c83a-4b00-9b3b-6b0637175d17</guid><dc:creator>Masahiro Kondo</dc:creator><description>&lt;p&gt;I&amp;nbsp;checked library just in case but it is definitely&amp;nbsp;nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib in source files but somehow it doesn&amp;#39;t seem to find sd_ functions. If you could upload project/sln files, that will be much appreciated. It must be some simple setting somewhere I don&amp;#39;t understand..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building the examples in pc-ble-driver from scratch</title><link>https://devzone.nordicsemi.com/thread/214286?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 08:05:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56425d11-cea6-40ab-a34b-28e0847eab35</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Hopefully whats in your library &amp;#39;lib&amp;#39; is the static lib, not the dynamic. The error indictes VS is not finding your static library. If helpful, I can zip up my entire VS project/sln for you. I have started the attempt to make it secure (force pairing) which does not work yet. It is easy to remove that code since I have not gotten very far. I get another error that makes no sense but I have gotten the central to initiate pairing!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building the examples in pc-ble-driver from scratch</title><link>https://devzone.nordicsemi.com/thread/214237?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 23:28:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca1ea0f5-7716-4904-9c3a-a99e72511d17</guid><dc:creator>Masahiro Kondo</dc:creator><description>&lt;p&gt;Hi, I followed Sigurd&amp;#39;s instruction with Console app, but I get lots of errors which are very similar to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/brianreinhold"&gt;brianreinhold&lt;/a&gt; had before (e.g. unresolved external symbol _sd_ble_gap_conn_param_update referenced...). I did add .lib to Source Files instead of linker settings. Is there any instruction missing? I can see&amp;nbsp;nrf-ble-driver-sd_api_v6-mt-4_1_1.dll, do I need to do anything about this? I am using VisualStudio 2019.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building the examples in pc-ble-driver from scratch</title><link>https://devzone.nordicsemi.com/thread/213568?ContentTypeID=1</link><pubDate>Mon, 07 Oct 2019 08:34:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d506fbc7-0e70-4673-b302-8ee168f45330</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;So far that is what I have done. Except I did not start with the Console project; I started with an empty project but all my properties are filled in as above. I used the properties pages to point to the library but did not add it to the source files. Did that; made no difference. Same 10 LNK2019 errors. Out of desperation I will blow away everything, start from scratch from a console app instead of an empty project and see if that works. (I also have _WIN32 which I think it should be given what&amp;#39;s in the source code.)&lt;/p&gt;
&lt;p&gt;It makes no sense, There must be some other piece of configuration information that I have not gotten. I have the configuration set to x64 and not x86 (I think I tried that out of desperation too). Is that a potential issue?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I blew away everything and started with a console app instead of an empty project. That worked. I cannot tell the difference but in the console app I did not use the property pages to point to the static library. I added it to the source file filter (did that in the empty project too but it did not help). The only difference between the two is the linking of the libraries. In the empty project I set the build to use static debug and set the linker to point to the libraries (this is what I have always done in Visual Studio). Any idea why that does not work? I might want to make this a Win32 GUI application and now I am afraid as how to link needed libraries. Is it something special about the nordic library that &lt;strong&gt;CANT&lt;/strong&gt; be linked via the properties pages?&lt;/p&gt;
&lt;p&gt;I verified the answer (though I don&amp;#39;t know why I cant sue the property pages). But in doing so the issue got closed. So I had to reject the answer. That I will change if someone can give any insight into why the library has to be linked this way ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building the examples in pc-ble-driver from scratch</title><link>https://devzone.nordicsemi.com/thread/213557?ContentTypeID=1</link><pubDate>Mon, 07 Oct 2019 07:57:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:192467da-bce8-4e54-8e23-08f9d4d7f72e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Here are the steps I used to compile the project with VS Studio 2017:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;New project -&amp;gt; Visual C++ -&amp;gt; Windows Console Application -&amp;gt; OK&lt;/li&gt;
&lt;li&gt;In ConesoleApplication.cpp, I replaced the content with this one -&amp;gt; &lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver/blob/master/examples/heart_rate_collector/main.c"&gt;https://github.com/NordicSemiconductor/pc-ble-driver/blob/master/examples/heart_rate_collector/main.c&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;In the Solution Explorer, right click on ConsoleApplication -&amp;gt; Properties -&amp;gt; VC++ Directories -&amp;gt; &amp;ldquo;Include Directories&amp;rdquo; -&amp;gt; Edit -&amp;gt;&amp;nbsp; New line, find the pc-ble-driver include folder , (e.g. C:\Nordic\nrf-ble-driver-4.1.1-win_x86_32 \include\sd_api_v6) -&amp;gt; OK.&lt;/li&gt;
&lt;li&gt;In the Solution Explorer, right click on ConsoleApplication -&amp;gt; Properties -&amp;gt; C/C++ -&amp;gt; Preprocessor -&amp;gt; Preprocessor Definitions -&amp;gt; Edit-&amp;gt; By default there are &amp;ldquo;WIN32, _DEBUG and _CONSOLE. Add:&lt;br /&gt; &lt;br /&gt; PC_BLE_DRIVER_STATIC&lt;br /&gt; &lt;br /&gt; &amp;nbsp;_CRT_SECURE_NO_WARNINGS&lt;br /&gt; &lt;br /&gt; NRF_SD_BLE_API=6 &amp;nbsp;&lt;/li&gt;
&lt;li&gt;In the Solution Explorer, right click on ConsoleApplication -&amp;gt; Properties -&amp;gt; C/C++ -&amp;gt; Precompiled Headers -&amp;gt; Precompiled Header -&amp;gt; Set to &amp;ldquo;Not using precompiled Headers&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;In the Solution Explorer, right click on Header Files -&amp;gt; Add -&amp;gt; Existing Item.. -&amp;gt; Mark all the .h files in folder &amp;ldquo;nrf-ble-driver-4.1.1-win_x86_32\include\sd_api_v6&amp;rdquo;, there should be 18 files -&amp;gt; OK.&lt;/li&gt;
&lt;li&gt;In the Solution Explorer, right click on &amp;ldquo;Source Files&amp;rdquo;, Add -&amp;gt; Existing Item.. -&amp;gt; Find the lib folder, and add nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib -&amp;gt; OK&lt;/li&gt;
&lt;li&gt;Build -&amp;gt; Build&amp;nbsp;Solution&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building the examples in pc-ble-driver from scratch</title><link>https://devzone.nordicsemi.com/thread/213475?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 16:48:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7841b6d9-56e2-4e69-a95b-50a0f2e18b36</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Interesting. Visual Studio already has a parameter setting to indicate whether one is using static or dynamic libraries.&lt;/p&gt;
&lt;p&gt;In any case, adding those two reduces the number of undefined symbols from 16 to 9. There must be more preprocessors or libraries missing.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1&amp;gt;nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib(sd_rpc_impl.cpp.obj) : error LNK2019: unresolved external symbol __imp_strncpy referenced in function sd_rpc_serial_port_enum&lt;br /&gt;1&amp;gt;nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib(serial_port_enum.cpp.obj) : error LNK2019: unresolved external symbol __imp_strstr referenced in function &amp;quot;class std::list&amp;lt;struct SerialPortDesc,class std::allocator&amp;lt;struct SerialPortDesc&amp;gt; &amp;gt; __cdecl EnumSerialPorts(void)&amp;quot; (?EnumSerialPorts@@YA?AV?$list@USerialPortDesc@@V?$allocator@USerialPortDesc@@@std@@@std@@XZ)&lt;br /&gt;1&amp;gt;nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib(serial_port_enum.cpp.obj) : error LNK2019: unresolved external symbol __imp_strtok_s referenced in function &amp;quot;class std::list&amp;lt;struct SerialPortDesc,class std::allocator&amp;lt;struct SerialPortDesc&amp;gt; &amp;gt; __cdecl EnumSerialPorts(void)&amp;quot; (?EnumSerialPorts@@YA?AV?$list@USerialPortDesc@@V?$allocator@USerialPortDesc@@@std@@@std@@XZ)&lt;br /&gt;1&amp;gt;nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib(serial_port_enum.cpp.obj) : error LNK2019: unresolved external symbol __imp__stricmp referenced in function &amp;quot;class std::list&amp;lt;struct SerialPortDesc,class std::allocator&amp;lt;struct SerialPortDesc&amp;gt; &amp;gt; __cdecl EnumSerialPorts(void)&amp;quot; (?EnumSerialPorts@@YA?AV?$list@USerialPortDesc@@V?$allocator@USerialPortDesc@@@std@@@std@@XZ)&lt;br /&gt;1&amp;gt;nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib(disphelper.c.obj) : error LNK2019: unresolved external symbol __imp__gmtime64 referenced in function ConvertTimeTToVariantTime&lt;br /&gt;1&amp;gt;nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib(disphelper.c.obj) : error LNK2019: unresolved external symbol __imp__localtime64 referenced in function ConvertTimeTToVariantTime&lt;br /&gt;1&amp;gt;nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib(disphelper.c.obj) : error LNK2019: unresolved external symbol __imp__mktime64 referenced in function ConvertTimeTToVariantTime&lt;br /&gt;1&amp;gt;nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib(jlinkid_reg_lookup.cpp.obj) : error LNK2019: unresolved external symbol __imp_memchr referenced in function &amp;quot;char const * __cdecl std::_Find_unchecked1&amp;lt;char const *,unsigned char&amp;gt;(char const *,char const *,unsigned char const &amp;amp;,struct std::integral_constant&amp;lt;bool,1&amp;gt;)&amp;quot; (??$_Find_unchecked1@PEBDE@std@@YAPEBDPEBD0AEBEU?$integral_constant@_N$00@0@@Z)&lt;br /&gt;1&amp;gt;nrf-ble-driver-sd_api_v6-mt-static-4_1_1.lib(jlinkid_reg_lookup.cpp.obj) : error LNK2019: unresolved external symbol __imp_realloc referenced in function &amp;quot;public: void __cdecl std::_Buf&amp;lt;char&amp;gt;::_Insert&amp;lt;char const *&amp;gt;(char const *,char const *)&amp;quot; (??$_Insert@PEBD@?$_Buf@D@std@@QEAAXPEBD0@Z)&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building the examples in pc-ble-driver from scratch</title><link>https://devzone.nordicsemi.com/thread/213449?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 14:13:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d586e534-9c91-4a7c-99c4-2c07b1816dd8</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]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. [/quote]
&lt;p&gt;You also need to add&amp;nbsp;&lt;span&gt;PC_BLE_DRIVER_STATIC and&amp;nbsp;_CRT_SECURE_NO_WARNINGS&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>