<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[cURL and Qt Project]]></title><description><![CDATA[<p dir="auto">I have created a QT project for a desktop application and I am able to work with it right. However I now need the curl library and need to use it correctly. But the compilations hs problems. The issue is I downloaded the source from <a href="https://curl.haxx.se/download.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://curl.haxx.se/download.html</a> and using the documentation from <a href="http://doc.qt.io/qt-5/third-party-libraries.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/third-party-libraries.html</a> . I am importing curl.h in one of my .cpp files like the curl doc says. But I am getting an error <strong>cannot find -lcurl</strong></p>
<p dir="auto">Here is what I have included in my .pro file</p>
<p dir="auto">INCLUDEPATH += vendor/curl/include/curl \</p>
<p dir="auto">LIBS += -L"vendor/curl/lib" -lcurl</p>
]]></description><link>https://forum.qt.io/topic/77129/curl-and-qt-project</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 18:55:55 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/77129.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 12 Mar 2017 10:23:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to cURL and Qt Project on Mon, 13 Mar 2017 17:58:37 GMT]]></title><description><![CDATA[<p dir="auto">Ah no. I am using mingw compiler and qtcompiler with mingw</p>
]]></description><link>https://forum.qt.io/post/381811</link><guid isPermaLink="true">https://forum.qt.io/post/381811</guid><dc:creator><![CDATA[ganeshkbhat]]></dc:creator><pubDate>Mon, 13 Mar 2017 17:58:37 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Mon, 13 Mar 2017 08:05:44 GMT]]></title><description><![CDATA[<p dir="auto">Usually when that works, it's because you have the matching .lib files (in the case of Visual Studio) in the same folder as your .dll files and the linker picks that one up.</p>
]]></description><link>https://forum.qt.io/post/381662</link><guid isPermaLink="true">https://forum.qt.io/post/381662</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 13 Mar 2017 08:05:44 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Mon, 13 Mar 2017 03:54:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tham">@<bdi>tham</bdi></a><br />
<code>May I ask you why you refuse to use the network modules provided by Qt5?</code><br />
The network modules of QT is good! I can say that looking at the class documentation though I am a beginner with QT. I needed time tracking based results for network requests like this <a href="http://i63.tinypic.com/21ls83l.png" target="_blank" rel="noopener noreferrer nofollow ugc">http://i63.tinypic.com/21ls83l.png</a> which is quite cumbersome and may be not possible with the QT network module.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a><br />
You can link external .dll files for your point <code>You don't link to .dll files.</code> . I was able to do that for an external library linking with QT using sqlite3.dll and it worked fine. Not sure why you referred that.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tham">@<bdi>tham</bdi></a><br />
<code>recently I found the same issue with those deep learning libraries written by python, the truth is, many developers do not care as long as their libs work on linux.</code><br />
True. I found that. But QT is not like that. QT is a commercial product for sale. Thats what makes a product/concept mature and marketable.</p>
<p dir="auto">I definitely believe there needs to be better documentation on minor issues and tweaks for product like QT. Frankly, its one of the best I found for C++ UI Controls and the performance is... good for the features it provides.</p>
]]></description><link>https://forum.qt.io/post/381611</link><guid isPermaLink="true">https://forum.qt.io/post/381611</guid><dc:creator><![CDATA[ganeshkbhat]]></dc:creator><pubDate>Mon, 13 Mar 2017 03:54:11 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Mon, 13 Mar 2017 03:06:29 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">One of the biggest issues of C++ community and adoption is the project set up documentation and project deployment documentation is not good.</p>
</blockquote>
<p dir="auto">I share your pain, but this is not just the problem of c++, recently I found the same issue with those deep learning libraries written by python, the truth is, many developers do not care as long as their libs work on linux.</p>
<p dir="auto">May I ask you why you refuse to use the network modules provided by Qt5?</p>
]]></description><link>https://forum.qt.io/post/381605</link><guid isPermaLink="true">https://forum.qt.io/post/381605</guid><dc:creator><![CDATA[tham]]></dc:creator><pubDate>Mon, 13 Mar 2017 03:06:29 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Mon, 13 Mar 2017 01:17:16 GMT]]></title><description><![CDATA[<p dir="auto">I was using mingw and cygwin compiler. I sat the whole night figuring out what issue was and found that it was the path "resolution" issue as mrjj pointed out.</p>
<p dir="auto">Here is what resolved my issue for developers who face the issue of External Library not linking correctly to a QT project in windows:</p>
<ol>
<li>I added the .lib / .dll.a file with full path (from C:) in .pro</li>
<li>I added the include full path (from C:) in .pro</li>
<li>I added the curl.exe and libcurl.exe in the release folders along with other dependency .dlls</li>
</ol>
<p dir="auto">Detailed steps:</p>
<ol>
<li>
<p dir="auto">Instead of the relative path, I gave the actual full path to library file in the .pro file and it resolved my issue. Here are the file paths I added.<br />
<code>C:\git\QT\APITester\vendor\curl\lib\libcurl.dll.a</code>  or <code>C:\git\QT\APITester\vendor\curl\lib\libcurl.lib</code> and</p>
</li>
<li>
<p dir="auto">I added the include full path:  <code>C:\git\QT\APITester\vendor\curl\include</code></p>
</li>
<li>
<p dir="auto">I added the <code>curl.exe</code> and <code>libcurl.dll</code> in the release folder (main folder) with other dependency .dlls of QT and created a release build.</p>
</li>
</ol>
<p dir="auto">The above steps work as well for debug but you have to have dlld files there for curl there</p>
<p dir="auto">I do not know what config settings are getting messed up for this issue to happen. And most of all such linking issues with third party libraries are not documented well. One of the biggest issues of C++ community and adoption is the project set up documentation and project deployment documentation is not good.</p>
<p dir="auto">This community saved me here. Thanks all for the effort and support. Thanks to <a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> and <a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> who spent time to answer my questions.</p>
]]></description><link>https://forum.qt.io/post/381592</link><guid isPermaLink="true">https://forum.qt.io/post/381592</guid><dc:creator><![CDATA[ganeshkbhat]]></dc:creator><pubDate>Mon, 13 Mar 2017 01:17:16 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Sun, 12 Mar 2017 21:02:30 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">You don't link to .dll files.</p>
<p dir="auto">Note that you haven't answered <a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a>'question: which compiler are you using ?</p>
]]></description><link>https://forum.qt.io/post/381569</link><guid isPermaLink="true">https://forum.qt.io/post/381569</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 12 Mar 2017 21:02:30 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Sun, 12 Mar 2017 19:43:45 GMT]]></title><description><![CDATA[<p dir="auto">Hmm.... seems like an issue here. I am actually doing a release build and <code>win32:CONFIG(release, debug|release): LIBS += -L$$PWD/vendor/curl/lib/ -lcurl.dll</code> does not work. I have created a new project with just one file and the curl functions and seems it is still giving the same error.</p>
]]></description><link>https://forum.qt.io/post/381564</link><guid isPermaLink="true">https://forum.qt.io/post/381564</guid><dc:creator><![CDATA[ganeshkbhat]]></dc:creator><pubDate>Sun, 12 Mar 2017 19:43:45 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Sun, 12 Mar 2017 17:10:58 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
Sometimes you need to use the .lib file if using visual studio.<br />
what compiler ?<br />
Also i hope you compiled all of curl yourself.</p>
<p dir="auto">try with<br />
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/vendor/curl/lib/ -lcurl.dll<br />
( that is remove the lib start of the name. here.)<br />
make release build.</p>
<p dir="auto">Sorry its hard to offer more input without  the compiler output :)</p>
<p dir="auto">I think its nearly correct. path seems fine etc.</p>
]]></description><link>https://forum.qt.io/post/381544</link><guid isPermaLink="true">https://forum.qt.io/post/381544</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sun, 12 Mar 2017 17:10:58 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Sun, 12 Mar 2017 15:39:27 GMT]]></title><description><![CDATA[<p dir="auto">QT       += core gui<br />
QT       += quickcontrols2</p>
<p dir="auto">greaterThan(QT_MAJOR_VERSION, 4): QT += widgets</p>
<p dir="auto">TARGET = APITester<br />
TEMPLATE = app</p>
<p dir="auto">DEFINES += QT_DEPRECATED_WARNINGS</p>
<p dir="auto">#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000</p>
<p dir="auto">SOURCES +=  main.cpp<br />
mainwindow.cpp <br />
apitab.cpp \</p>
<p dir="auto">HEADERS  += mainwindow.h <br />
apitab.h \</p>
<p dir="auto">FORMS    += mainwindow.ui <br />
apitab.ui \</p>
<p dir="auto">DISTFILES +=</p>
<p dir="auto">RESOURCES +=</p>
<p dir="auto">INCLUDEPATH +=</p>
<p dir="auto">LIBS +=</p>
<p dir="auto">win32:CONFIG(release, debug|release): LIBS += -L$$PWD/vendor/curl/lib/ -llibcurl.dll<br />
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/vendor/curl/lib/ -llibcurl.dlld<br />
else:unix: LIBS += -L$$PWD/vendor/curl/lib/ -llibcurl.dll</p>
<p dir="auto">INCLUDEPATH += $$PWD/vendor/curl/include \</p>
<p dir="auto">DEPENDPATH += $$PWD/vendor/curl/include</p>
<p dir="auto">win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/vendor/curl/lib/libcurl.dll.a<br />
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/vendor/curl/lib/libcurl.dlld.a<br />
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/vendor/curl/lib/libcurl.dll.lib<br />
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/vendor/curl/lib/libcurl.dlld.lib<br />
else:unix: PRE_TARGETDEPS += $$PWD/vendor/curl/lib/libcurl.dll.a</p>
<p dir="auto">==========================</p>
<p dir="auto">The folder structure is :</p>
<p dir="auto">projectfolder/<br />
file.cpp (and others)<br />
file.h<br />
main.cpp<br />
vendor/<br />
vendor/curl/<br />
vendor/curl/include/<br />
vendor/curl/include/curl.h (and others)<br />
vendor/curl/lib/<br />
vendor/curl/lib/libcurl.dll.a</p>
<h2>Errors are follow (one of them is. Its one of the functions curl exposes) :</h2>
<p dir="auto">undefined reference to _imp__curl_easy_init()'</p>
]]></description><link>https://forum.qt.io/post/381525</link><guid isPermaLink="true">https://forum.qt.io/post/381525</guid><dc:creator><![CDATA[ganeshkbhat]]></dc:creator><pubDate>Sun, 12 Mar 2017 15:39:27 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Sun, 12 Mar 2017 15:27:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ganeshkbhat">@<bdi>ganeshkbhat</bdi></a><br />
Hi<br />
Try to post the .pro file and the output in Creators compiler output panel<br />
It stills sounds like its not linking. There must be errors somewhere.</p>
]]></description><link>https://forum.qt.io/post/381523</link><guid isPermaLink="true">https://forum.qt.io/post/381523</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sun, 12 Mar 2017 15:27:46 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Sun, 12 Mar 2017 13:54:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> I have now been able to compile the libcurl.dll.a file into the lib folder and used a library importer to create the library dependency. Now the -lcurl error is gone. But it still gives undefined errors. What declaration have I gone wrong at? Error is &gt;&gt;&gt; <code>:-1: error: undefined reference to _imp__curl_easy_init'</code> and error are there for other curl functions as well.</p>
<p dir="auto">This is my import :<br />
#include &lt;curl/curl.h&gt;</p>
<p dir="auto">This is my code within my widget constructor</p>
<p dir="auto">CURL *curl;<br />
CURLcode res;</p>
<pre><code>  curl = curl_easy_init();
  if(curl) {
      curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      res = curl_easy_perform(curl);
      if(res != CURLE_OK){
          qWarning("curl_easy_perform() failed: \n");
      }
    curl_easy_cleanup(curl);
</code></pre>
]]></description><link>https://forum.qt.io/post/381514</link><guid isPermaLink="true">https://forum.qt.io/post/381514</guid><dc:creator><![CDATA[ganeshkbhat]]></dc:creator><pubDate>Sun, 12 Mar 2017 13:54:13 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Sun, 12 Mar 2017 11:39:51 GMT]]></title><description><![CDATA[<p dir="auto">I remove the -lcurl key and it allowed me to compile but not I have a bunch of errors of undefined related to functions used by curl. eg:  undefined reference to 'curl_easy_init()' . Seems like the path issue itself. Any help? I have the source files in the folders and the lib folder has both source .cpp files as well as built binary (which i put for testing purposes only). Any help. Is it wise to compile the curl first and then use the library dll in the project?</p>
]]></description><link>https://forum.qt.io/post/381508</link><guid isPermaLink="true">https://forum.qt.io/post/381508</guid><dc:creator><![CDATA[ganeshkbhat]]></dc:creator><pubDate>Sun, 12 Mar 2017 11:39:51 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Sun, 12 Mar 2017 11:01:42 GMT]]></title><description><![CDATA[<p dir="auto">I have my project in <code>tester/allMyFilesAndFolders</code> . It also means that my vendor folder is within <code>tester/vendor/curl</code> Is that also wrong?</p>
<p dir="auto">Second, I have downloaded all the source. Not the built ones so I am able to use that in both windows and linux after compilation. I have not built the libCurl first but I have tried putting the binary in the lib folder and tried but it did not work.</p>
]]></description><link>https://forum.qt.io/post/381505</link><guid isPermaLink="true">https://forum.qt.io/post/381505</guid><dc:creator><![CDATA[ganeshkbhat]]></dc:creator><pubDate>Sun, 12 Mar 2017 11:01:42 GMT</pubDate></item><item><title><![CDATA[Reply to cURL and Qt Project on Sun, 12 Mar 2017 11:00:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ganeshkbhat">@<bdi>ganeshkbhat</bdi></a><br />
The paths looks wrong ?</p>
<p dir="auto">When they are not full as in<br />
c:/vendor/xxx<br />
then often they are relative<br />
../../vendor/xxxx</p>
<p dir="auto">Yours seems to be neither ?</p>
<p dir="auto">Also, its unclear if you build it all your self or you try to use PRECOMPILED dlls ?<br />
Did you fist build the actual libCurl ?</p>
]]></description><link>https://forum.qt.io/post/381504</link><guid isPermaLink="true">https://forum.qt.io/post/381504</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sun, 12 Mar 2017 11:00:06 GMT</pubDate></item></channel></rss>