Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, April 2007
Qt 4.2 Visual Studio 2005 static with no dependencies - MSVCRT link error


Message 1 in thread

This is getting complicated.

I am trying to get Qt 4.2 built STATICALLY with Visual Studio 2005 on 
Windows such that it doesn't rely on external DLLs - in other words, 
using the -MT instead of the -MD compile switch.

I have followed the directions here:
<http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Windows>

While compiling using "nmake sub-src", it looks like it gets to the end 
of compiling "moc", and has these link errors:


link /NOLOGO /INCREMENTAL:NO /INCREMENTAL:NO /SUBSYSTEM:CONSOLE 
/MANIFESTFILE:"release\moc.intermediate.manifest" 
/OUT:..\..\..\bin\moc.exe @C:\DOCUME~1\paul\LOCALS~1\Temp\nm859.tmp
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall 
type_info::type_info(class type_info const &)" 
(??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & 
__thiscall type_info::operator=(class type_info const &)" 
(??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other 
libs; use /NODEFAULTLIB:library
..\..\..\bin\moc.exe : fatal error LNK1169: one or more multiply defined 
symbols found


Is there a quick workaround for this? Looks like I need to use the 
/NODEFAULTLIB switch somewhere but I'm not exactly sure where. This 
isn't mentioned in the howto I pointed to earlier.

-- 
 [ signature omitted ]