skydevgit / crisscross

Automatically exported from code.google.com/p/crisscross
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Linker errors when building in VS 2008 #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I don't know if this is due to my previous issue, but I am now getting the 
follow linker errors:
1>------ Build started: Project: Inceku, Configuration: Debug Win32 ------
1>Linking...
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall 
std::basic_string<char,struct std::char_traits<char>,class 
std::allocator<char> >::~basic_string<char,struct 
std::char_traits<char>,class std::allocator<char> >(void)" (??1?
$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already 
defined in CrissCross.lib(core_io_reader.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: __thiscall 
std::basic_string<char,struct std::char_traits<char>,class 
std::allocator<char> >::basic_string<char,struct 
std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?
$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) 
already defined in CrissCross.lib(debug.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static unsigned int 
__cdecl std::char_traits<char>::length(char const *)" (?length@?
$char_traits@D@std@@SAIPBD@Z) already defined in CrissCross.lib(debug.obj)
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class 
std::basic_string<char,struct std::char_traits<char>,class 
std::allocator<char> > & __thiscall std::basic_string<char,struct 
std::char_traits<char>,class std::allocator<char> >::operator=(char const 
*)" (??4?$basic_string@DU?$char_traits@D@std@@V?
$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in 
CrissCross.lib(core_socket.obj)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(tidtable.obj) : error LNK2005: __encode_pointer already 
defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(tidtable.obj) : error LNK2005: __decode_pointer already 
defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __malloc_dbg already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __free_dbg already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtDumpMemoryLeaks already 
defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already 
defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in 
MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in 
MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in 
MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in 
MSVCRTD.lib(cinitexe.obj)
1>LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?
terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined 
in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invalid_parameter already 
defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined 
in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(setlocal.obj) : error LNK2005: __configthreadlocale already 
defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in 
MSVCRTD.lib(crtexe.obj)
1>LIBCMTD.lib(errmode.obj) : error LNK2005: ___set_app_type already defined 
in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already 
defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(dosmap.obj) : error LNK2005: __errno already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(dbgrptt.obj) : error LNK2005: __CrtSetReportMode already 
defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(dbgrptt.obj) : error LNK2005: __CrtSetReportFile already 
defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(atox.obj) : error LNK2005: _atoi already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined 
in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(osfinfo.obj) : error LNK2005: __open_osfhandle already 
defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(_file.obj) : error LNK2005: ___iob_func already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in 
MSVCRTD.lib(MSVCR90D.dll)
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other 
libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other 
libs; use /NODEFAULTLIB:library
1>D:\dev\repos\git\inceku\Debug\Inceku.exe : fatal error LNK1169: one or 
more multiply defined symbols found
1>Build log was saved at 
"file://d:\dev\repos\git\inceku\Inceku.dir\Debug\BuildLog.htm"
1>Inceku - 39 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========

You can find the latest source for Inceku at 
http://github.com/eddieringle/inceku/

Everything builds fine on my Linux box, so I'm guessing it's either a CMake 
issue or a CrissCross issue under Windows.

Original issue reported on code.google.com by eddie.ri...@gmail.com on 26 Apr 2009 at 4:33

GoogleCodeExporter commented 9 years ago
You probably have a run-time library inconsistency.

Check under the two projects' properties. go to 'Code generation'. I think 
CrissCross should say 'Multithreaded 
Debug'. Set your project to be the same (it is probably set to 'Multithreaded 
Debug DLL').

For Release build, do the same, except set both to 'Multithreaded'.

Original comment by steven.n...@gmail.com on 26 Apr 2009 at 4:54

GoogleCodeExporter commented 9 years ago
I dunno how I would fix that in my CMake file, you wrote that. ;)

But fixing the setting worked, Inceku finally builds under Windows.

Original comment by eddie.ri...@gmail.com on 26 Apr 2009 at 6:11

GoogleCodeExporter commented 9 years ago
It's the /MT{d} vs /MD{d}. Do something like this guy did:

http://www.cmake.org/pipermail/cmake/2005-November/007466.html

Or you could copy the stuff I did. It's in the CMakeLists.txt in the root 
directory of the project.

Original comment by steven.n...@gmail.com on 26 Apr 2009 at 11:39