[Qt-interest] Building Qt 4.4.3: linker errors LNK2019 w/ MSVC2003 on Windows

Robert Hairgrove evorgriahr at hispeed.ch
Thu Dec 11 13:53:47 CET 2008


I am trying to build the Qt libraries using the free MSVC 2003 toolkit. 
The Microsoft link.exe cannot find the following symbol, the member 
function QString::begin(), which is defined inline in <qstring.h>. Here 
is the error message I get when the build process gets around to linking 
the QCore4.dll:

==== NMAKE output =====
Generating Code...
     	link /LIBPATH:"f:\Qt\4.4.3\lib" /LIBPATH:"f:\Qt\4.4.3\lib" /NOLOGO 
/BASE
:0x67000000 /INCREMENTAL:NO /DLL /VERSION:4.43 
/OUT:..\..\lib\QtCore4.dll @F:\TE
MP\nmA4.tmp
    Creating library ..\..\lib\QtCore4.lib and object ..\..\lib\QtCore4.exp
QtCore_pch.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport
) public: unsigned short * __thiscall std::basic_string<unsigned 
short,struct st
d::char_traits<unsigned short>,class std::allocator<unsigned short> 
 >::begin(voi
d)" 
(__imp_?begin@?$basic_string at GU?$char_traits at G@std@@V?$allocator at G@2@@std@@Q
AEPAGXZ) referenced in function "public: class 
std::basic_string<unsigned short,
struct std::char_traits<unsigned short>,class std::allocator<unsigned 
short> > _
_thiscall QString::toStdWString(void)const " 
(?toStdWString at QString@@QBE?AV?$bas
ic_string at GU?$char_traits at G@std@@V?$allocator at G@2@@std@@XZ)
..\..\lib\QtCore4.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.
NMAKE : fatal error U1077: 'F:\PSDK\Bin\nmake.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
==== end NMAKE output ====

I have configured like this:

==== config ====
configure -platform win32-msvc2003 -release -no-webkit -qt-sql-odbc 
-qt-sql-sqlite
==== end config ====

I have built Qt before successfully, both on Windows and on Linux (last 
time was 4.3.0, also with this compiler). Also, if I use the /Zc:wchar_t 
option (=wchar_t is a native type instead of a typedef) I get the same 
error message except that basic_string<wchar_t ...etc....> instead of 
basic_string<unsigned short ...etc...> is returned in the above error 
message.

Both the missing function QString::begin() (returns a non-const 
QString::iterator) and the calling function QString::toStdWString() are 
inlined in the header qstring.h. Of course, both are defined. Is this 
some limitation of the MSVC 2003 Toolkit compiler (AKA MSVC 7.1 for 
.NET) regarding inline functions?

Thanks!



More information about the Qt-interest-old mailing list