unresolved external symbol gethostbyname

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ramakrishna
Posts: 2
Joined: Wed, 2007-09-19, 17:56
Contact:

unresolved external symbol gethostbyname

#1 Post by ramakrishna »

hello everyone,
i am doing a project on telemedicine..i am planning to use dicom toolkit version 3.5.4
but i am not able to implement it on windows system..
i am getting linking errors ..
first i got these errors
""
e:\project\dcm\ofstd\libsrc\ofthread.cxx(140) : error C2065: '_beginthreadex' : undeclared identifier
e:\project\dcm\ofstd\libsrc\ofthread.cxx(217) : error C2065: '_endthreadex' : undeclared identifier
""

then i run it in multithread environment by changing my project dcmconv properties to multithreaded DLL
then this error i ws able to solve
then i got this bunch of errors::
from here i am not able to proceed..i asked my friends nobody solved my problem . i am particularly getting main problem in dcuid.cxx , in this i am getting error like
undefined gethostname:

--------------------Configuration: dcmconv - Win32 Debug--------------------
Linking...
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::ios_base::Init::Init(void)" (??0Init@ios_base@std@@QAE@XZ) already defined in libcpd.lib(iostream.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::ios_base::Init::~Init(void)" (??1Init@ios_base@std@@QAE@XZ) already defined in libcpd.lib(iostream.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::_Winit::_Winit(void)" (??0_Winit@std@@QAE@XZ) already defined in libcpd.lib(wiostrea.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::_Winit::~_Winit(void)" (??1_Winit@std@@QAE@XZ) already defined in libcpd.lib(wiostrea.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
dcuid.obj : error LNK2001: unresolved external symbol _WSACleanup@0
dcuid.obj : error LNK2001: unresolved external symbol _gethostbyname@4
dcuid.obj : error LNK2001: unresolved external symbol _gethostname@8
dcuid.obj : error LNK2001: unresolved external symbol _WSAStartup@8
dcuid.obj : error LNK2001: unresolved external symbol _Netbios@4
Debug/dcmconv.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.

dcmconv.exe - 10 error(s), 1 warning(s)


friends anybody who has idea about these ..plz kindly help i desparately need it..
one thing i didnt got:
what is msvcprtd.lib i am not including that program anywhere.is it there any dicom 3.5.4

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

#2 Post by Marco Eichelberg »

See FAQ #26. DCMTK and the external libraries used by DCMTK are by default compiled for the static multithread C runtime, and you cannot mix code compiled for different versions of the C runtime in MSVC.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest