Linker Error

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
elturco
Posts: 8
Joined: Thu, 2006-12-07, 18:08

Linker Error

#1 Post by elturco »

Hii,

I have problems with running Dcmtk on Visual Studio 2005. Here are the Error messages :

Code: Select all

61>LIBCMTD.lib(_file.obj) : error LNK2005: ___iob_func already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(dbgheap.obj) : error LNK2005: _calloc already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(dbgheap.obj) : error LNK2005: _realloc already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(dbgheap.obj) : error LNK2005: _free already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(dosmap.obj) : error LNK2005: __errno already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(isctype.obj) : error LNK2005: __isctype already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj)
61>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj)
61>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj)
61>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj)
61>LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(winsig.obj) : error LNK2005: _signal already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(stricmp.obj) : error LNK2005: __stricmp already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(vsprintf.obj) : error LNK2005: _vsprintf already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in MSVCRTD.lib(crtexe.obj)
61>LIBCMTD.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(tolower.obj) : error LNK2005: _tolower already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(getenv.obj) : error LNK2005: _getenv already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(printf.obj) : error LNK2005: _printf already defined in MSVCRTD.lib(MSVCR80D.dll)
61>LIBCMTD.lib(strnicmp.obj) : error LNK2005: __strnicmp already defined in MSVCRTD.lib(MSVCR80D.dll)
62>LINK : Debug\dcm2pnm.exe not found or not built by the last incremental link; performing full link
61>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __fileno already defined in LIBCMTD.lib(fileno.obj)
61>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __write already defined in LIBCMTD.lib(write.obj)
61>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __get_osfhandle already defined in LIBCMTD.lib(osfinfo.obj)
61>   Creating library Debug\dcmpssnd.lib and object Debug\dcmpssnd.exp
61>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
61>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
I tried to build all the file (ALL_BUILD). The FAQ didn`t help me really. I build all the Files.

How can I change the configuration that is valid for all the files in ALL_BUILD and without to pick each File to make changes ?

How can I fix this problem ?

Can anyone help me please ?

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1446
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

See FAQ #26.

elturco
Posts: 8
Joined: Thu, 2006-12-07, 18:08

#3 Post by elturco »

Thank you Marco...

I followed the instruction on FAQ 26, i change the whole appearance of MT and MTd in CMakeList.txt, then push the button "configure and ok " on Cmake . Reload the Files in Visual but i'm getting still the error messages. Do you have an another idea, how to fix it ?

elturco
Posts: 8
Joined: Thu, 2006-12-07, 18:08

#4 Post by elturco »

It's me again, in the settings of the Project, I ignored the Libcmtd.lib but now, i have an another error message:

dcmtkeay_d.lib(v3_conf.obj) : error LNK2019: unresolved external symbol __pctype referenced in function _X509V3_EXT_nconf
dcmtkeay_d.lib(conf_mod.obj) : error LNK2001: unresolved external symbol __pctype
dcmtkeay_d.lib(x509_cmp.obj) : error LNK2001: unresolved external symbol __pctype
dcmtkeay_d.lib(obj_dat.obj) : error LNK2001: unresolved external symbol __pctype
dcmtkeay_d.lib(b_print.obj) : error LNK2001: unresolved external symbol __pctype

in google i found nothing about it, did anyone know it ?

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1446
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#5 Post by Marco Eichelberg »

I would suggest that you use CMake to disable all external libraries, and then re-compile DCMTK and see if it works. If you change any of the code generation options (most importantly, /MT, /MTd, /MD, /MDd), none of the pre-compiled libraries will work anymore and you will have to manually re-compile all of these libraries from source.

elturco
Posts: 8
Joined: Thu, 2006-12-07, 18:08

#6 Post by elturco »

Thank for your reply Marco...

Ok, i know want you mean, but can you explain me please how can i recompile the libs manually, or do you have a link about this.

I thought to uninstall CMake and reinstall it again and make the changes with MD and MDd before to run in Visual.

I would be very appreciate, if you can give me short description or a link to recompile the libs manually.

elturco
Posts: 8
Joined: Thu, 2006-12-07, 18:08

#7 Post by elturco »

Hii,

after changing the configuration in Properties->Configuration Properties->General->Configuration Type from "Application.exe" to "static library" for example by "dsrdump" the error messages disappeared.

@DCMTK Team and others: would this change could cause any problems in further applications ?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest