Results 1 to 3 of 3

Thread: qt application using cURL compiled in Visual Studio 2010

  1. #1
    Join Date
    Dec 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default qt application using cURL compiled in Visual Studio 2010

    Hello everyone!,

    i am developing an application in which i am using cURL for getting source code of webpages. Now I need GUI a I choose Qt...
    But I have problem with linking cURL with Qt ..
    I am really confused, this is first time where I am linking multiple different libraries in windows.

    What I need:
    - it would be great if will be application portable. No install, just copy.
    - as small size of application as possible.

    I downloaded source code of Qt 4.7.4 and compiled with Visual Studio 2010, but without param -static. Then installed add-in/VS 2010, and write some code for GUI, then added cURL. But problem is, that my cUrl is compilided asstatic library, and now I have some problems with linking.

    I suppose that I must use cURL compiled as dynamic library, if I want use my actually compiled Qt.

    What would be better for my needs? Qt compiled as dynamic with cURL as dynamic, or all as static?
    Can somebody explain me, or give me some links where it is described?

    Thanks.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qt application using cURL compiled in Visual Studio 2010

    You can use a static libcurl and a dynamic Qt without a problem. Since you don't tell us what the "I have some problems with linking" are so we cannot provide any specific help. You probably have incorrect or missing LIBS entries in your pro file.

  3. #3
    Join Date
    Dec 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt application using cURL compiled in Visual Studio 2010

    Thanks for your reply Chris..

    I am very glad reading "You can use a static libcurl and a dynamic Qt without a problem."

    Errors shown in Visual Studio:

    error LNK1169: one or more multiply defined symbols found
    error LNK2005: ___iob_func already defined in MSVCRTD.lib(MSVCR100D.dll)
    many other similar errors..

    warnings
    warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
    warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library

    ... When I compiled libcurl I used /MTd Multi-Threaded debug, now when I compiling my app, and including libcurl as library I must use /MDd Multi-Threaded Debug DLL, but this not works.
    And why I am using /MDd?
    Because If I try compile my very simple Qt app without anything (no explicit library), just ui and one connect/slot, it cannot compiles if I set /MTd Multi-Threaded, only compiles with Runtime Library set to /MDd.

    So what can be solution? Compiling libcurl with Runtime Lib set to MDd?
    Or recompile Qt as static? I think this error is there because I am mixing Runtime Libraries ...

    The best solution for me will be, if it can be possible to distribute app without requiring qt installed on enduser PC.

    Thanks.


    Added after 28 minutes:


    solved... i compile cURL with Runtime Library set to Multi-threaded debug and it works..i had not idea about what i have been doing ...
    Last edited by xrep; 24th December 2011 at 00:19.

Similar Threads

  1. Qt 4.7 and Visual Studio 2010 - cannot launch compiled Qt Applications
    By Schreihals in forum Installation and Deployment
    Replies: 1
    Last Post: 31st January 2011, 11:28
  2. Qt and Visual Studio 2010
    By SixDegrees in forum Qt Programming
    Replies: 6
    Last Post: 15th November 2010, 19:56
  3. Visual Studio Plugin (1.1.6) crashes Visual Studio (2010)
    By mboeni in forum Installation and Deployment
    Replies: 0
    Last Post: 11th October 2010, 16:46
  4. How to Qt4.7 Source with Visual Studio 2010
    By Aenima1981 in forum Installation and Deployment
    Replies: 0
    Last Post: 1st October 2010, 14:00
  5. Plan for Visual Studio 2010 (MSVC 2010)?
    By Vinzz in forum Qt Programming
    Replies: 1
    Last Post: 18th April 2010, 17:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.