error LNK2019: unresolved external symbol

Compilation and installation of DCMTK

Moderator: Moderator Team

Message
Author
ruchir_iit
Posts: 4
Joined: Fri, 2016-11-25, 10:31

Re: error LNK2019: unresolved external symbol

#16 Post by ruchir_iit »

Thanks Michael for your reply. I used the guidelines on http://support.dcmtk.org/redmine/projec ... uration360 to configure CMake. Sorry but I'm not sure where is the option to choose shared or static libraries.

Regards,
Ruchir

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: error LNK2019: unresolved external symbol

#17 Post by Michael Onken »

Hi,

sorry, not sure where the problem comes from. Maybe you can restart the whole build process from scratch. Otherwise:

Are you compiling DCMTK 3.6.0?

If so, can you also try a current snapshot?

Can you use try a more current version of Visual Studio, too?

Best,
Michael

ruchir_iit
Posts: 4
Joined: Fri, 2016-11-25, 10:31

Re: error LNK2019: unresolved external symbol

#18 Post by ruchir_iit »

Hi Michael,

Thanks for the suggestions. OK, I tried the snapshot without building shared libraries when configuring using CMake. I am using VS2013.

Upon compilation I was getting a few other errors which I resolved. But still the following errors remain:

ofstd.lib(ofstd.obj) : error LNK2019: unresolved external symbol _NetWkstaUserGetInfo@12 referenced in function "public: static class OFString __cdecl OFStandard::getUserName(void)" (?getUserName@OFStandard@@SA?AVOFString@@XZ)
1>dcmdata.lib(dcuid.obj) : error LNK2019: unresolved external symbol _Netbios@4 referenced in function "unsigned char * __cdecl getMACAddress(unsigned char * const)" (?getMACAddress@@YAPAEQAE@Z)


Regards,
Ruchir

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: error LNK2019: unresolved external symbol

#19 Post by Michael Onken »

Weird.
What kind of other errors? It should build out of the box with no errors, so there is definitely something fishy.

Did you try a static (i.e. non-shared) build as I proposed before?

Michael

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: error LNK2019: unresolved external symbol

#20 Post by J. Riesmeier »

What kind of other errors? It should build out of the box with no errors, so there is definitely something fishy.
As far as I understood the OP, the error is not with the compilation of the DCMTK but with the integration of it into another porgram.

ruchir_iit
Posts: 4
Joined: Fri, 2016-11-25, 10:31

Re: error LNK2019: unresolved external symbol

#21 Post by ruchir_iit »

Yeah, @J. Riesmeier is right. The errors are when I integrate DCMTK with VS and compile a trial VS project. DCMTK compilation was fine.
Did you try a static (i.e. non-shared) build as I proposed before?
During CMake configuration, I did not check the box against BUILD_SHARED_LIBS which should mean static build, right?

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: error LNK2019: unresolved external symbol

#22 Post by Michael Onken »

Yes, I lost track over the length of the thead.

The setting about shared or static build should be the same as you used when building DCMTK.

If you link your own programs against DCMTK, try linking against all libraries that also comparable DCMTK libraries have been linked to; e.g. if you compile an application for DCMTK networking, you could try copying the libraries that were used when building DCMTK's storescu.

Michael

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest