PDA

View Full Version : Linking Static Library with Qt Creator



augusbas
12th September 2013, 04:51
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.

scarecr0w132
12th September 2013, 05:41
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

augusbas
12th September 2013, 06:00
Hi scarecr0w132

i am compiling with visual studio x86 compiler .

scarecr0w132
12th September 2013, 06:08
Hi scarecr0w132

i am compiling with visual studio x86 compiler .

visual studio 2010 compiler?
lnk errors can come from different versions of visual studio