Results 1 to 4 of 4

Thread: Linking Static Library with Qt Creator

  1. #1
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Linking Static Library with Qt Creator

    Hi all,

    I got a 3rd Party Static library (.lib) and relevant header file with functions. No dll is provided.

    I have included the lib with Qt Creator and it could successfully locate the library. But the function call specified with the library called from my program provides me Linker error unresolved external symbol error as below

    mainwindow.obj : error LNK2019: unresolved external symbol "unsigned char __cdecl cio_init(unsigned char)" (?cio_init@@YAEE@Z) referenced in function "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QAE@PAVQWidget@@@Z)
    release\CioTestX86.exe : fatal error LNK1120: 1 unresolved externals

    The same library and header file works in VS2010 IDE.

    Need some inputs to solve the above error . Whether i have to use cmake instead of qmake ? Please support.

  2. #2
    Join Date
    May 2013
    Posts
    45
    Thanks
    6
    Thanked 6 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Linking Static Library with Qt Creator

    What compiler are you using?
    Tools->options->Build&Run-> Qt Versions
    I assume you are compiling with MinGW and linking libraries build with visual studio 2010

  3. #3
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Linking Static Library with Qt Creator

    Hi scarecr0w132

    i am compiling with visual studio x86 compiler .

  4. #4
    Join Date
    May 2013
    Posts
    45
    Thanks
    6
    Thanked 6 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Linking Static Library with Qt Creator

    Quote Originally Posted by augusbas View Post
    Hi scarecr0w132

    i am compiling with visual studio x86 compiler .
    visual studio 2010 compiler?
    lnk errors can come from different versions of visual studio

Similar Threads

  1. Replies: 2
    Last Post: 11th August 2012, 17:37
  2. Replies: 2
    Last Post: 19th February 2011, 11:26
  3. Linking a foreign static library using QtCreator
    By gib in forum Qt Programming
    Replies: 0
    Last Post: 22nd September 2010, 02:52
  4. Linking to a static library on Windows
    By rexi in forum Qt Programming
    Replies: 9
    Last Post: 27th July 2009, 19:54
  5. Trouble linking static library
    By russdot in forum Qt Programming
    Replies: 3
    Last Post: 17th May 2009, 10:56

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.