<?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>Visual Studio Code and library libpq</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92280/visual-studio-code-and-library-libpq</link><description>Hello 
 How can I add libpq sample project to connect to postgresql database, can&amp;#39;t add libpq-fe.h? I previously installed vcpkg. 
 Can anyone help?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Sep 2022 13:54:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92280/visual-studio-code-and-library-libpq" /><item><title>RE: Visual Studio Code and library libpq</title><link>https://devzone.nordicsemi.com/thread/388167?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 13:54:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8424263a-4c22-4171-bc04-b5e2b6548ff9</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Libpq is a third party library which we do not support. You could ask for support from postgresql community. You could probably build libpq from the source, but there might be many dependencies for which we do not have support. Additionally, it is unlikely that it would work. Therefore, I do not think it would be good way forward. Another option is to&amp;nbsp;implement communication protocol yourself which could communicate with your database. This may not be easy to implement yourself. Finally, you can set up a server which could connect to the database. You could use CoAP or MQTT for this purpose. You could use nRF9160 to connect to the server which would communicate with the database.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Visual Studio Code and library libpq</title><link>https://devzone.nordicsemi.com/thread/388065?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 08:54:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a6d0c6a-fbe1-4801-838b-abae702e30d8</guid><dc:creator>Roald</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for the answer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In the project, I want to send data to a postgresql database. The data I send is temperature and humidity from the sensor.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:185px;max-width:130px;" height="185" src="https://devzone.nordicsemi.com/resized-image/__size/260x370/__key/communityserver-discussions-components-files/4/pastedimage1664267369655v1.png" width="130" alt=" " /&gt;&lt;a id="" href="https://www.farnell.com/datasheets/2773931.pdf"&gt;https://www.farnell.com/datasheets/2773931.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In your answer, I understood that it is not possible to do it in the way I tried to do it.&lt;/p&gt;
&lt;p&gt;So do I have to somehow libpq a static library and then add it to the CMakeLists.txt file and then try to built it?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1664268288070v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But how can I make libpq a static library?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Visual Studio Code and library libpq</title><link>https://devzone.nordicsemi.com/thread/387958?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 13:49:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f644781-deb0-4b95-9b0b-98d7cfeab6da</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Could you provide more information on what are you trying to do in this project?&lt;br /&gt;&lt;br /&gt;After installation of vcpkg, there is a message that &amp;quot;-DCMAKE_TOOLCHAIN_FILE=&amp;lt;vcpkg path&amp;gt;/scripts/buildsystems/vcpkg.cmake&amp;quot; should be used by CMake projects. Based on this&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/23387"&gt;answer&lt;/a&gt;, it&amp;nbsp;seems that using CMAKE_TOOLCHAIN_FILE is not supported.&lt;br /&gt;&lt;br /&gt;You could try building the library from the source, but there are many other library dependencies. Therefore, this approach might not work as well.&lt;br /&gt;&lt;br /&gt;You could also have a look at Zephyr&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/application_development/external_lib"&gt;external library sample&lt;/a&gt;&amp;nbsp;which explains how to include external library to the Zephyr build system.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>