Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The use of INCLUDE_* macros is deprecated #10

Open
ehoefel opened this issue Jan 31, 2023 · 3 comments
Open

The use of INCLUDE_* macros is deprecated #10

ehoefel opened this issue Jan 31, 2023 · 3 comments

Comments

@ehoefel
Copy link

ehoefel commented Jan 31, 2023

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

@DraconPern
Copy link
Owner

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

@john-jam
Copy link
Contributor

john-jam commented Feb 8, 2023

@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
Copy link
Contributor

john-jam commented Feb 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants