Link errors

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

Link errors

#1 Post by paolom »

Hi, I try to make a simple class using the DcmFileFormat class and when i compile is ok but when I link there are many errors like this:

In function `MyDicom::SaveDicom()': undefined reference to `DcmFileFormat::saveFile(char const*, E_TransferSyntax, E_EncodingType, E_GrpLenEncoding, E_PaddingEncoding, unsigned long, unsigned long, int)'|

I've included in the linker options all the library that I obtained with the compilation of the dcmtk-3.5.4 (libofstd.a, libdcmdata.a, ecc.).

Which is the problem?

Thanks

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 »

The order in which you specify libraries is significant. For DcmFileFormat::saveFile you need to link -ldcmdata -lofstd, in that order.

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

link errors

#3 Post by paolom »

I've this order now:

libdcmdata.a

libofstd.a

libdcmnet.a

libdcmimage.a


Now I've only three errors about saveDicom() findAndGetString() and PutAndInsertString()

Does I need more library? Which is the correct order?

Thanks

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

#4 Post by Jörg Riesmeier »

Which is the correct order?
Read FAQ #27 (the library order is also valid for non-Windows systems).

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

link errors

#5 Post by paolom »

I've linked the libraries in the correct order but the linking doesn't work.

I work with the GCC 4.2.3 under Ubuntu/CodeBlocks.

I see on the INSTALL file that dcmtk has been tested with older version then GCC 4.2.3..is possible that with an higher version of GCC dcmtk doesn't work correctly?

Is possible that the compilation doesn't make correctly the libdcmdata.a?

Or...somebody has any solutions?

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

#6 Post by Marco Eichelberg »

I don't think that gcc 4.2 is the problem - if so, you should have received errors while compiling DCMTK.

Also, you are not seriously asking the forum whether or not file libdcmdata.a has been created, do you? You are the only person who can verify that.

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

link errors

#7 Post by paolom »

Hi,

I've solved...the problem is that it must INSERT COMPILER DEFINE

HAVE_CONFIG_H=1

All other problems are all correlated.

Bye

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest