PDA

View Full Version : 2019 linker error



bmn
1st June 2008, 04:58
After installing the commercial version of Qt 4.4.0 and attempting to compile a test project in Visual Studio 2008 I get:


------ Build started: Project: qttest2, Configuration: Debug Win32 ------
Linking...
qtmaind.lib(qtmain_win.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::locale::facet::_Register(void)" (__imp_?_Register@facet@locale@std@@QAEXXZ) referenced in function "class std::ctype<char> const & __cdecl std::use_facet<class std::ctype<char> >(class std::locale const &)" (??$use_facet@V?$ctype@D@std@@@std@@YAABV?$ctype@D @0@ABVlocale@0@@Z)
qtmaind.lib(qtmain_win.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned int __cdecl std::ctype<char>::_Getcat(class std::locale::facet const * *)" (__imp_?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@local e@2@@Z) referenced in function "class std::ctype<char> const & __cdecl std::use_facet<class std::ctype<char> >(class std::locale const &)" (??$use_facet@V?$ctype@D@std@@@std@@YAABV?$ctype@D @0@ABVlocale@0@@Z)
qtmaind.lib(qtmain_win.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned int __cdecl std::ctype<unsigned short>::_Getcat(class std::locale::facet const * *)" (__imp_?_Getcat@?$ctype@G@std@@SAIPAPBVfacet@local e@2@@Z) referenced in function "class std::ctype<unsigned short> const & __cdecl std::use_facet<class std::ctype<unsigned short> >(class std::locale const &)" (??$use_facet@V?$ctype@G@std@@@std@@YAABV?$ctype@G @0@ABVlocale@0@@Z)
C:\Documents and Settings\Kyle\My Documents\Visual Studio 2008\Projects\qttest2\Debug\qttest2.exe : fatal error LNK1120: 3 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Kyle\My Documents\Visual Studio 2008\Projects\qttest2\qttest2\Debug\BuildLog.htm"
qttest2 - 4 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


How can I resolve this issue?

wysota
1st June 2008, 11:29
What do you consider a "test project"?

Azriel
1st June 2008, 17:35
I am newbe and I have same problem. I had created application with Application Wizard as described in QT Tutorial. I don't add any code, just try to build new solution and give same result. IMHO It's mean that qt libraries are using other version of crt library as my installation of VS 2008. Can somebody tell how to resolve this problem or rebuild QT-commercial. Thanks.
My configuration: MS VS 2008 Standard, Vista Home Premium 32-bit

bmn
1st June 2008, 17:57
What do you consider a "test project"?
A blank Qt application, just the GUI.

wysota
2nd June 2008, 08:21
What do you mean by "blank"? :) Could you provide the code?

sadjoker
5th June 2008, 01:59
Got the same thing with QT 4.4.0 and VC++ 2008 express
When i add CONFIG += console it compiles without linking errors. But i don`t need the console :)
Weird.

wysota
5th June 2008, 08:18
So how about showing us the code?

sadjoker
5th June 2008, 09:50
It`s the standart code from the examples. Nothing changed. I just get any example ... got Desktop -> Systray first, compile it without Config += console in the project file and it gives exactly 3 linking errors. When i enable console, its linking ok.
Fixed it with recompiling QT 4.4.0 with VC++ Express 2008. Now its ok. It took several hours tho... that webKit :) put some hours to compile.

sadjoker
6th June 2008, 16:25
If someone gets the same error.. i fixed it with compiling C:\Qt\4.4.0\src\winmain again with my version of the MS crt files. The other libs are intact from the install. All seems working for now.

pcmantinker
4th July 2008, 06:55
Thanks for the information. Here is a tutorial on how to compile Qt with Visual Studio's compiler: http://tom.paschenda.org/blog/?p=28
It's quite helpful. The compiling process takes a while, but it will be worth it.

Flakes
29th July 2008, 01:56
If someone gets the same error.. i fixed it with compiling C:\Qt\4.4.0\src\winmain again with my version of the MS crt files. The other libs are intact from the install. All seems working for now.

thanks pal, it helped me too! I advise to recompile winmain with both Release and Debug configurations