0
votes

I am using itk library for reading my .dcm files using its example in: https://itk.org/Doxygen46/html/IO_2DicomImageReadWrite_8cxx-example.html.

When I use CMake to build this example its appear that everything is OK and I can for example write my .dcm in .png format. But when I use Visual Studio (2015-2013-2010) I face with these errors:

LNK1120 4 unresolved externals
LNK2019 unresolved external symbol gethostname referenced in function "public: static bool __cdecl gdcm::System::GetHostName(char * const)" (?GetHostName@System@gdcm@@SA_NQEAD@Z)  
LNK2019 unresolved external symbol WSACleanup referenced in function "public: static bool __cdecl gdcm::System::GetHostName(char * const)" (?GetHostName@System@gdcm@@SA_NQEAD@Z)   
LNK2019 unresolved external symbol WSAStartup referenced in function "public: static bool __cdecl gdcm::System::GetHostName(char * const)" (?GetHostName@System@gdcm@@SA_NQEAD@Z)   Read_Write  
LNK2019 unresolved external symbol __imp_UuidCreate referenced in function "protected: static bool __cdecl gdcm::UIDGenerator::GenerateUUID(unsigned char *)" (?GenerateUUID@UIDGenerator@gdcm@@KA_NPEAE@Z) 

It seems that there is something wrong with gdcm.

1
"When I use CMake to build this example" - did you mean when you use make, like on Linux or Mac? Otherwise the question hardly makes sense.Dženan
@Dzenan I did not use make on those platforms. I used CMake in windows to build my .exe.Rasoul

1 Answers

2
votes

About the socket functions: seems you should link your project to WS2_32.lib

About the __imp_UuidCreate: seems to be a known issue.