Project

General

Profile

Bug #1578

win64 debug build fails to link

Added by Jim Phillips about 2 years ago. Updated about 2 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Machine Layers
Target version:
-
Start date:
05/31/2017
Due date:
% Done:

0%


Description

Build options are "--no-build-shared --enable-randomized-msgq --with-prio-type=int --enable-error-checking -debug", affects multicore-win64 and mpi-win64[-smp].

Following errors when linking megatest:

LIBCMTD.lib(dbgheap.obj) : error LNK2005: _heap_alloc already defined in LIBCMT.lib(malloc.obj)^M
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _msize already defined in LIBCMT.lib(msize.obj)^M
LIBCMTD.lib(dbgheap.obj) : error LNK2005: _recalloc already defined in LIBCMT.lib(recalloc.obj)^M
LIBCMTD.lib(isctype.obj) : error LNK2005: _isctype already defined in LIBCMT.lib(isctype.obj)^M
LIBCMTD.lib(isctype.obj) : error LNK2005: _isctype_l already defined in LIBCMT.lib(isctype.obj)^M
LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in LIBCMT.lib(dbghook.obj)^M
libckmain.a(main.o) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in megatest.o^M
libckmain.a(main.o) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in megatest.o^M
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library^M
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library^M

History

#1 Updated by Phil Miller about 2 years ago

  • Status changed from New to Rejected

This error occurs when part of the code (i.e. the runtime) was compiled with -g, while other parts (megatest) was compiled without -g. MSVC does not support mixing objects compiled in debug and non-debug modes, since (as seen) it references different symbols from the libraries, only one set of which can actually be linked.

Please compile and link everything on Windows with MSVC using the same setting of with or without -g

For reference, the -debug flag to charmc selects Charm++-runtime specific debugging features related to Charmdebug - it's separate from asking for debug symbols.

I'm marking this 'Rejected', but feel free to re-open if it there's some further issue beyond the inconsistency.

Also available in: Atom PDF