Compilation issue with latest dcmtk (build with cmake)

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#1 Post by Per »

While on this topic, I get a compilation issue with latest dcmtk from git (built with cmake):

Code: Select all

/home/per/dcmtk/ofstd/libsrc/ofconapp.cc: In member function ‘void OFConsoleApplication::printWarning(const char*, const char*)’:
/home/per/dcmtk/ofstd/libsrc/ofconapp.cc:203: error: ‘strlen’ was not declared in this scope
make[2]: *** [ofstd/libsrc/CMakeFiles/ofstd.dir/ofconapp.o] Error 1
Including <string.h> fixes the problem.

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 »

Which platform are you using? I also tested the new cmake project files on our main development system (GNU/Linux 2.6 with gcc 4.1) and it works without problems.

Are you sure that you've used the latest version from the git repository? I'm asking because last Friday there were some string related changes.

Uli Schlachter
DCMTK Developer
Posts: 120
Joined: Thu, 2009-11-26, 08:15

#3 Post by Uli Schlachter »

Sorry that I missed this one. The next update of the git repository should fix this.

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#4 Post by Per »

Thanks. That works now :-)

New problem from out of source build with cmake and latest dcmtk from git:

Linking CXX executable dcm2pdf
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
make[2]: *** [dcmdata/apps/dcm2pdf] Error 1

Building with ./configure works fine.

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

#5 Post by Jörg Riesmeier »

Could you please retry it with a clean build directory (i.e. make sure that no old object or program files from a previous "configure use" reside in the build directory).

Per
Posts: 99
Joined: Mon, 2007-09-03, 10:53
Location: Trondheim, Norway
Contact:

#6 Post by Per »

Doing a 'make dist' in the source dir fixed the problem. This is somewhat odd, though, since an out of source build with cmake should not be using in source object files from a ./configure build...?

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

#7 Post by Michael Onken »

Hi,

I think it is because the source file in the CMakeLists.txt files are named dcm2pdf without extension. That's why maybe cmake is irritated when files like dcm2pdf already exist in that directory and then take precedence over dcm2pdf.cc.

That's at least my guess.

Best regards,
Michael

Post Reply

Who is online

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