LINK error

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
jmartens
Posts: 15
Joined: Wed, 2005-02-02, 10:36

LINK error

#1 Post by jmartens »

I'm a newbie at programming in C++ and am trying to get some grip on the DCMTK. Maybe some one can help me out...

I would like to build a program that generaturs a UID using the dcmGenerateUniqueIdentifier as defined in the /dcmdata/include/dcuid.cxx

So I opened my MS Visual C++ 6 and started a new workspace, and added my project called dcuid

I added the projects dcmdata and ofstd to the workspace and set their dependencies as followed (as found in FAQ 27:

dcuid :arrow: dcmdata
dcmdata :arrow: ofstd

I added a simple main routine in a file called test.cpp, first without the include files but then it started complaining about missing header files and I added them until no missing header files were reported, I also added the paths to the Include steting in the project settings menu so the program knows where it can look for the inlcude files:

Code: Select all

#include "oftypes.h"
#include "osconfig.h"
#include "dcuid.h"

int main()
{
  char buf[70];
  dcmGenerateUniqueIdentifier(buf);
  return 0;
}
After linking netapi32.lib and wsock32.api to solve some errors about netbios (also mentioned in FAQ 27) I get the following output when I try to compile:

Code: Select all

--------------------Configuration: dcuid - Win32 Release--------------------
Compiling...
test.cpp
Linking...
LIBCMT.lib(_file.obj) : error LNK2005: ___initstdio already defined in LIBC.lib(_file.obj)
LIBCMT.lib(_file.obj) : error LNK2005: ___endstdio already defined in LIBC.lib(_file.obj)
LIBCMT.lib(_file.obj) : error LNK2005: __cflush already defined in LIBC.lib(_file.obj)
LIBCMT.lib(_file.obj) : error LNK2005: __iob already defined in LIBC.lib(_file.obj)
LIBCMT.lib(osfinfo.obj) : error LNK2005: __alloc_osfhnd already defined in LIBC.lib(osfinfo.obj)
LIBCMT.lib(osfinfo.obj) : error LNK2005: __set_osfhnd already defined in LIBC.lib(osfinfo.obj)
LIBCMT.lib(osfinfo.obj) : error LNK2005: __free_osfhnd already defined in LIBC.lib(osfinfo.obj)
LIBCMT.lib(osfinfo.obj) : error LNK2005: __get_osfhandle already defined in LIBC.lib(osfinfo.obj)
LIBCMT.lib(osfinfo.obj) : error LNK2005: __open_osfhandle already defined in LIBC.lib(osfinfo.obj)
LIBCMT.lib(lseek.obj) : error LNK2005: __lseek already defined in LIBC.lib(lseek.obj)
LIBCMT.lib(winsig.obj) : error LNK2005: _signal already defined in LIBC.lib(winsig.obj)
LIBCMT.lib(winsig.obj) : error LNK2005: _raise already defined in LIBC.lib(winsig.obj)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in LIBC.lib(winxfltr.obj)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptActTabCount already defined in LIBC.lib(winxfltr.obj)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __Num_FPE already defined in LIBC.lib(winxfltr.obj)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __First_FPE_Indx already defined in LIBC.lib(winxfltr.obj)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptActTab already defined in LIBC.lib(winxfltr.obj)
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
Release/dcuid.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

dcuid.exe - 18 error(s), 1 warning(s)
Can some one help me out or pint me to the solution of my problem? Where do enter the

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

See FAQ #26.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest