fmjpeg2koj icon indicating copy to clipboard operation
fmjpeg2koj copied to clipboard

The use of INCLUDE_* macros is deprecated

Open ehoefel opened this issue 2 years ago • 3 comments

Many of the c files in this repo have instructions like this in dcmjp2k.cc:

#define INCLUDE_CSTDLIB
#define INCLUDE_CSTDIO
#define INCLUDE_CSTRING

Those instructions are not supported by newer versions of dcmtk and are causing errors during compilation. They should be replaced by:

#include <cstdlib>
#include <cstdio>
#include <cstring>

and others, respectfully

ehoefel avatar Jan 31 '23 09:01 ehoefel

thanks for the report, i'll take a look. Which version of dcmtk were you compiling with?

DraconPern avatar Feb 06 '23 11:02 DraconPern

@DraconPern To add more info, this happens with the DCMTK-3.6.7 version. I tried to create a fork with a fix but end up with another error when building with build.sh Release on Ubuntu 20.04.5:

[ 69%] Built target fmjpeg2k
Scanning dependencies of target dcmdjp2k
Scanning dependencies of target dcmcjp2k
[ 84%] Building CXX object CMakeFiles/dcmcjp2k.dir/dcmcjp2k.cc.o
[ 84%] Building CXX object CMakeFiles/dcmdjp2k.dir/dcmdjp2k.cc.o
[ 92%] Linking CXX executable dcmdjp2k
[100%] Linking CXX executable dcmcjp2k
/usr/bin/ld: cannot find -lofstd
/usr/bin/ld: cannot find -loflog
/usr/bin/ld: cannot find -ldcmdata
/usr/bin/ld: cannot find -li2d
/usr/bin/ld: cannot find -ldcmimgle
/usr/bin/ld: cannot find -ldcmimage
/usr/bin/ld: cannot find -ldcmjpeg
/usr/bin/ld: cannot find -lijg8
/usr/bin/ld: cannot find -lijg12
/usr/bin/ld: cannot find -lijg16
/usr/bin/ld: cannot find -ldcmjpls
/usr/bin/ld: cannot find -ldcmtkcharls
/usr/bin/ld: cannot find -ldcmtls
/usr/bin/ld: cannot find -ldcmnet
/usr/bin/ld: cannot find -ldcmsr
/usr/bin/ld: cannot find -lcmr
/usr/bin/ld: cannot find -ldcmdsig
/usr/bin/ld: cannot find -ldcmwlm
/usr/bin/ld: cannot find -ldcmqrdb
/usr/bin/ld: cannot find -ldcmpstat
/usr/bin/ld: cannot find -ldcmrt
/usr/bin/ld: cannot find -ldcmiod
/usr/bin/ld: cannot find -ldcmfg
/usr/bin/ld: cannot find -ldcmseg
/usr/bin/ld: cannot find -ldcmtract
/usr/bin/ld: cannot find -ldcmpmap
/usr/bin/ld: cannot find -ldcmect
/usr/bin/ld: cannot find -lofstd
/usr/bin/ld: cannot find -loflog
/usr/bin/ld: cannot find -ldcmdata
/usr/bin/ld: cannot find -li2d
/usr/bin/ld: cannot find -ldcmimgle
/usr/bin/ld: cannot find -ldcmimage
/usr/bin/ld: cannot find -ldcmjpeg
/usr/bin/ld: cannot find -lijg8
/usr/bin/ld: cannot find -lijg12
/usr/bin/ld: cannot find -lijg16
/usr/bin/ld: cannot find -ldcmjpls
/usr/bin/ld: cannot find -ldcmtkcharls
/usr/bin/ld: cannot find -ldcmtls
/usr/bin/ld: cannot find -ldcmnet
/usr/bin/ld: cannot find -ldcmsr
/usr/bin/ld: cannot find -lcmr
/usr/bin/ld: cannot find -ldcmdsig
/usr/bin/ld: cannot find -ldcmwlm
/usr/bin/ld: cannot find -ldcmqrdb
/usr/bin/ld: cannot find -ldcmpstat
/usr/bin/ld: cannot find -ldcmrt
/usr/bin/ld: cannot find -ldcmiod
/usr/bin/ld: cannot find -ldcmfg
/usr/bin/ld: cannot find -ldcmseg
/usr/bin/ld: cannot find -ldcmtract
/usr/bin/ld: cannot find -ldcmpmap
/usr/bin/ld: cannot find -ldcmect
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/dcmdjp2k.dir/build.make:87: dcmdjp2k] Error 1
make[1]: *** [CMakeFiles/Makefile2:107: CMakeFiles/dcmdjp2k.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: cannot find -lofstd
/usr/bin/ld: cannot find -loflog
/usr/bin/ld: cannot find -ldcmdata
/usr/bin/ld: cannot find -li2d
/usr/bin/ld: cannot find -ldcmimgle
/usr/bin/ld: cannot find -ldcmimage
/usr/bin/ld: cannot find -ldcmjpeg
/usr/bin/ld: cannot find -lijg8
/usr/bin/ld: cannot find -lijg12
/usr/bin/ld: cannot find -lijg16
/usr/bin/ld: cannot find -ldcmjpls
/usr/bin/ld: cannot find -ldcmtkcharls
/usr/bin/ld: cannot find -ldcmtls
/usr/bin/ld: cannot find -ldcmnet
/usr/bin/ld: cannot find -ldcmsr
/usr/bin/ld: cannot find -lcmr
/usr/bin/ld: cannot find -ldcmdsig
/usr/bin/ld: cannot find -ldcmwlm
/usr/bin/ld: cannot find -ldcmqrdb
/usr/bin/ld: cannot find -ldcmpstat
/usr/bin/ld: cannot find -ldcmrt
/usr/bin/ld: cannot find -ldcmiod
/usr/bin/ld: cannot find -ldcmfg
/usr/bin/ld: cannot find -ldcmseg
/usr/bin/ld: cannot find -ldcmtract
/usr/bin/ld: cannot find -ldcmpmap
/usr/bin/ld: cannot find -ldcmect
/usr/bin/ld: cannot find -lofstd
/usr/bin/ld: cannot find -loflog
/usr/bin/ld: cannot find -ldcmdata
/usr/bin/ld: cannot find -li2d
/usr/bin/ld: cannot find -ldcmimgle
/usr/bin/ld: cannot find -ldcmimage
/usr/bin/ld: cannot find -ldcmjpeg
/usr/bin/ld: cannot find -lijg8
/usr/bin/ld: cannot find -lijg12
/usr/bin/ld: cannot find -lijg16
/usr/bin/ld: cannot find -ldcmjpls
/usr/bin/ld: cannot find -ldcmtkcharls
/usr/bin/ld: cannot find -ldcmtls
/usr/bin/ld: cannot find -ldcmnet
/usr/bin/ld: cannot find -ldcmsr
/usr/bin/ld: cannot find -lcmr
/usr/bin/ld: cannot find -ldcmdsig
/usr/bin/ld: cannot find -ldcmwlm
/usr/bin/ld: cannot find -ldcmqrdb
/usr/bin/ld: cannot find -ldcmpstat
/usr/bin/ld: cannot find -ldcmrt
/usr/bin/ld: cannot find -ldcmiod
/usr/bin/ld: cannot find -ldcmfg
/usr/bin/ld: cannot find -ldcmseg
/usr/bin/ld: cannot find -ldcmtract
/usr/bin/ld: cannot find -ldcmpmap
/usr/bin/ld: cannot find -ldcmect
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/dcmcjp2k.dir/build.make:87: dcmcjp2k] Error 1
make[1]: *** [CMakeFiles/Makefile2:134: CMakeFiles/dcmcjp2k.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I tried to add the option -DBUILD_SHARED_LIBS=ON to the DCMTK build so this creates the *.so files in the dcmtk folder and not only the *.a files but I still got the same ld errors.

Maybe you have an idea?

john-jam avatar Feb 08 '23 08:02 john-jam

I found a workaround by adding LINK_DIRECTORIES(${DCMTK_ROOT}/lib) in the CMakeLists.txt file so the *.so files built with the -DBUILD_SHARED_LIBS=ON on the DCMTK build are found. But this looks like not being the solution since now we have external DCMTK libraries and that's probably not what we want.

I am really not an expert with CMake and there should be a better solution to use the *.a files instead of the *.so.

john-jam avatar Feb 08 '23 23:02 john-jam