kdebase compile problem
Ralf Habacker
ralf.habacker at freenet.de
Fri Dec 21 17:54:02 CET 2007
Hi,
with cmake 2.4.7, CMAKE_BUILD_TYPE=RelWithDebInfo the following code in
FindKDE4Internals.cmake
# make sure that no header adds libcmt by default using #pragma
comment(lib, "libcmt.lib") as done by mfc/afx.h
KDE_CHECK_FLAG_EXISTS("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt"
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "Release with Debug Info")
KDE_CHECK_FLAG_EXISTS("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt"
CMAKE_EXE_LINKER_FLAGS_RELEASE "release")
KDE_CHECK_FLAG_EXISTS("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt"
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "release minsize")
KDE_CHECK_FLAG_EXISTS("/NODEFAULTLIB:libcmtd /DEFAULTLIB:msvcrtd"
CMAKE_EXE_LINKER_FLAGS_DEBUG "debug")
I got the following linker error, which indicates that
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO isn't used as I stated already
before.
Linking CXX executable ..\..\bin\khc_indexbuilder.exe
msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
type_info::type_info(class type_info const &)" (??0type_info@@AAE at AB
V0@@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 at ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
LIBCMT.lib(crt0init.obj) : warning LNK4098: defaultlib 'msvcrt.lib'
conflicts with use of other libs; use /NODEFAULTLIB:library
..\..\bin\khc_indexbuilder.exe : fatal error LNK1169: one or more
multiply defined symbols found
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~4\VC\bin\cl.exe' : return
code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Programme\Microsoft Platform SDK for
Windows Server 2003 R2\Bin\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Programme\Microsoft Platform SDK for
Windows Server 2003 R2\Bin\nmake.exe"' : return code '0x2'
Stop.
It only works when I use the following code CMAKE_EXE_LINKER_FLAGS
KDE_CHECK_FLAG_EXISTS("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt"
CMAKE_EXE_LINKER_FLAGS "Release")
Ralf
More information about the Kde-windows
mailing list