Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Libcurl inside Qt: can't find external symbol
Forum Updated to NodeBB v4.3 + New Features

Libcurl inside Qt: can't find external symbol

Scheduled Pinned Locked Moved 3rd Party Software
4 Posts 2 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    YouNix
    wrote on last edited by
    #1

    Hi,

    I have downloaded qt for my 64bit windows 8 machine and I am trying to use the curl library in my project. Please note that curl is a required and can't be avoided.

    So, I have downloaded a zip file from the website and in my .pro files I have added the following lines:

    DEFINES += CURL_STATICLIB
    INCLUDEPATH += "C:/Users/User/Documents/QTProjects/next/include"
    win32:LIBS += -L"C:/Users/User/Documents/QTProjects/next/lib" -lcurllib

    Where ../next/lib contains:

    • curllib.lib
    • curllib_static.lib
    • curllib.dll

    In my main function:

    @
    #define CURL_STATICLIB //not needed since defined in .pro
    #include <curl/curl.h>
    .....
    CURL *curl;
    CURLcode res;
    curl = curl_easy_init();@

    When I try to build and compile the project I come across this error:

    LNK2019: unresolved external symbol curl_easy_init referenced in function...

    Any ideas what is going wrong with this? I managed to get it to work with visual studio 2012 but Qt doesn't seem to like it.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You might have better chance to get an answer on the curl mailing list/forums.

      Anyway, shouldn't it be:

      @LIBS += -lcurl@

      ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        YouNix
        wrote on last edited by
        #3

        Getting the same error even with this modification :/

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Sorry, I have misread the name of your libraries, it seems that you indeed need to have curllib in your pro file.

          Since you are doing a static build (guessing that from your define) shouldn't you link to curllib_static ?

          @LIBS += -lcurllib_static@

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved