Minimal example (Linux) application using DCMTK with linking errors

All other questions regarding DCMTK

Moderator: Moderator Team

Message
Author
zardoz
Posts: 9
Joined: Mon, 2023-03-06, 09:29

Minimal example (Linux) application using DCMTK with linking errors

#1 Post by zardoz »

Hello,

I am trying to create a minimal example application using DCMTK, but I can't get it to compile correctly. I use Ubuntu 20.04 and compiled DCMTK successfully (some minor warnings only during compilation), as noted in the INSTALL file (with default cmake options).
I created a minimal CMakeLists.txt and demo.cc file according to the FAQ and forum discussion (things I also tried as comments):

Code: Select all

# CMakeLists.txt

project(DCMTK_DEMO)
cmake_minimum_required(VERSION 3.16)

# specify DCMTK's (default) installation directory
#set(DCMTK_DIR "/workspace/dcmtk-3.6.7-install")
#set(DCMTK_DIR "/workspace/dcmtk-3.6.7-install/usr/local/lib/cmake/dcmtk")
set(DCMTK_DIR "/workspace/dcmtk-3.6.7-build")

# use find_package() to search for installed DCMTK
find_package(DCMTK REQUIRED CONFIG)

# declare include directories
include_directories(${DCMTK_INCLUDE_DIRS})

# declare executable and link required libraries
add_executable(demo demo.cc)
#link_directories(${DCMTK_DIR}/lib)
#target_link_libraries(demo DCMTK::DCMTK)
target_link_libraries(demo ${DCMTK_LIBRARIES})

Code: Select all

// demo.cc

#include <iostream>
#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmdata/dctk.h"

using namespace std;

int main(int argc, char* argv[])
{
    /* iterate over all command line parameters */
    for (int i = 1; i < argc; i++)
    {
		/* load the specified DICOM file */
		DcmFileFormat dicomFile;
		if (dicomFile.loadFile(argv[i]).good())
		{
			/* and dump its content to the console */
			cout << "DICOM file: " << argv[i] << OFendl;
			dicomFile.print(cout);
			cout << OFendl;
		}
    }

    return 0;
}
cmake runs fine, but the DCMTK libraries are not found during linking:

Code: Select all

--- Log output of make

Scanning dependencies of target demo
[ 50%] Building CXX object CMakeFiles/demo.dir/demo.cc.o
[100%] Linking CXX executable demo
/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/demo.dir/build.make:84: demo] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/demo.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
Am I missing something else in my CMakeLists.txt, or must I set an environment variable?

Best regards,
Kai
Last edited by zardoz on Mon, 2023-03-06, 13:04, edited 1 time in total.

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

Re: Minimal example (Linux) application using DCMTK with liniking errors

#2 Post by Michael Onken »

Hi,

the lib directory where the DCMTK libraries (ofstd, dcmdata,...) can be found is missing, i.e. the linker does not find those DCMTK libraries. What happens if you uncomment the following line in your CMake script?

Code: Select all

#link_directories(${DCMTK_DIR}/lib)?
BR Michael

zardoz
Posts: 9
Joined: Mon, 2023-03-06, 09:29

Re: Minimal example (Linux) application using DCMTK with liniking errors

#3 Post by zardoz »

Hello Michael, thanks for helping out here.

Unfortunately, I still get the same error. I double checked that it is the correct directory:

Code: Select all

message("here:" ${DCMTK_DIR}/lib)
gives me

Code: Select all

here:/workspace/dcmtk-3.6.7-build/lib
and

Code: Select all

ls /workspace/dcmtk-3.6.7-build/lib
returns

Code: Select all

libcmr.a      libdcmect.a    libdcmimgle.a  libdcmjpls.a  libdcmpstat.a  libdcmseg.a       libdcmtls.a    libi2d.a    libijg8.a
libdcmdata.a  libdcmfg.a     libdcmiod.a    libdcmnet.a   libdcmqrdb.a   libdcmsr.a        libdcmtract.a  libijg12.a  liboflog.a
libdcmdsig.a  libdcmimage.a  libdcmjpeg.a   libdcmpmap.a  libdcmrt.a     libdcmtkcharls.a  libdcmwlm.a    libijg16.a  libofstd.a
Anything else I can try?

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

Re: Minimal example (Linux) application using DCMTK with liniking errors

#4 Post by Michael Onken »

Can you put this line

Code: Select all

add_executable(demo demo.cc)
as the last line in the script, i.e. in particular after the link_directories(...) command?

If this does not help, use

Code: Select all

make VERBOSE=1
to see the actual compiler and linker command used when calling "make".

zardoz
Posts: 9
Joined: Mon, 2023-03-06, 09:29

Re: Minimal example (Linux) application using DCMTK with liniking errors

#5 Post by zardoz »

Ok, I moved add_executable directly after link_directory (but before target_link_libraries as otherwise it tells me that demo is not a valid target). Now I get a long list of undefined references:

Code: Select all

Scanning dependencies of target demo
[ 50%] Building CXX object CMakeFiles/demo.dir/demo.cc.o
[100%] Linking CXX executable demo
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcfilefo.cc.o): in function `DcmFileFormat::remove(unsigned long)':
dcfilefo.cc:(.text+0x552): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x55f): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x64b): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcfilefo.cc.o): in function `DcmFileFormat::remove(DcmItem*)':
dcfilefo.cc:(.text+0x792): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x79f): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x88b): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcfilefo.cc.o): in function `DcmFileFormat::insertItem(DcmItem*, unsigned long)':
dcfilefo.cc:(.text+0x9d8): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x9e5): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0xad8): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcfilefo.cc.o): in function `DcmFileFormat::lookForXfer(DcmMetaInfo*)':
dcfilefo.cc:(.text+0xd90): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0xdbd): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0xe15): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0xe1e): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0xf33): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0xf51): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x106d): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x114c): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x12af): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcfilefo.cc.o): in function `DcmFileFormat::write(DcmOutputStream&, E_TransferSyntax, E_EncodingType, DcmWriteCache*, E_GrpLenEncoding, E_PaddingEncoding, unsigned int, unsigned int, unsigned int, E_FileWriteMode)':
dcfilefo.cc:(.text+0x2a23): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x2a30): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x2b23): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcfilefo.cc.o): in function `DcmFileFormat::convertCharacterSet(OFString const&, unsigned long)':
dcfilefo.cc:(.text+0x2ffd): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x300f): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x3168): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcfilefo.cc.o): in function `DcmFileFormat::checkMetaHeaderValue(DcmMetaInfo*, DcmDataset*, DcmTagKey const&, DcmObject*, E_TransferSyntax, E_FileWriteMode)':
dcfilefo.cc:(.text+0x36d0): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x36dd): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x3830): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x3960): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x396d): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x3ab8): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x3ca6): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x3cb3): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x3ea6): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x3ed5): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x3ee2): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x4006): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x41ee): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x41fb): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x4274): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x43c4): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x43d1): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x447e): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x44cb): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x44d8): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x4626): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x4698): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x485a): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x4867): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x498b): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x4c71): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x4c7e): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x4da2): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x4f10): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x4f1d): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x4fba): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x506c): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x5079): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x5116): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x5159): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x5272): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x527f): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x52ff): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x534c): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x5365): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x5395): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x54ae): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x54bb): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x553b): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x5588): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x55a1): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x55ae): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x564f): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x56bf): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x56cc): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x57bd): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x59ad): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x5a52): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x5b1c): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x5bbd): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x5bc7): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x5c66): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x5cb0): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x5d4f): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcfilefo.cc.o): in function `DcmFileFormat::validateMetaInfo(E_TransferSyntax, E_FileWriteMode)':
dcfilefo.cc:(.text+0x6666): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x66ce): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x66db): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x67da): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x69f9): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x6b1a): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcfilefo.cc:(.text+0x6b5d): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcfilefo.cc:(.text+0x6b6a): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcfilefo.cc:(.text+0x6c54): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmTempFileHandler::~DcmTempFileHandler()':
dcistrmf.cc:(.text+0x271): undefined reference to `OFMutex::~OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmInputTempFileStreamFactory::clone() const':
dcistrmf.cc:(.text+0x2c4): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcistrmf.cc:(.text+0x2d1): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmInputTempFileStreamFactory::~DcmInputTempFileStreamFactory()':
dcistrmf.cc:(.text+0x3c4): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcistrmf.cc:(.text+0x3d8): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcistrmf.cc:(.text+0x418): undefined reference to `OFMutex::~OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmInputTempFileStreamFactory::~DcmInputTempFileStreamFactory()':
dcistrmf.cc:(.text+0x486): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcistrmf.cc:(.text+0x49c): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcistrmf.cc:(.text+0x4dd): undefined reference to `OFMutex::~OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmTempFileHandler::DcmTempFileHandler(OFFilename const&)':
dcistrmf.cc:(.text+0xe18): undefined reference to `OFMutex::OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmTempFileHandler::newInstance(OFFilename const&)':
dcistrmf.cc:(.text+0xe76): undefined reference to `OFMutex::OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmTempFileHandler::increaseRefCount()':
dcistrmf.cc:(.text+0xec5): undefined reference to `OFMutex::lock()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmTempFileHandler::decreaseRefCount()':
dcistrmf.cc:(.text+0xef9): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcistrmf.cc:(.text+0xf0d): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcistrmf.cc:(.text+0xf4d): undefined reference to `OFMutex::~OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmInputTempFileStreamFactory::DcmInputTempFileStreamFactory(DcmTempFileHandler*)':
dcistrmf.cc:(.text+0xfb3): undefined reference to `OFMutex::lock()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmInputTempFileStreamFactory::DcmInputTempFileStreamFactory(DcmInputTempFileStreamFactory const&)':
dcistrmf.cc:(.text+0xff4): undefined reference to `OFMutex::lock()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmTempFileHandler::~DcmTempFileHandler()':
dcistrmf.cc:(.text+0x196): undefined reference to `OFMutex::~OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmTempFileHandler::increaseRefCount()':
dcistrmf.cc:(.text+0xed8): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmInputTempFileStreamFactory::DcmInputTempFileStreamFactory(DcmTempFileHandler*)':
dcistrmf.cc:(.text+0xfc6): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmInputTempFileStreamFactory::DcmInputTempFileStreamFactory(DcmInputTempFileStreamFactory const&)':
dcistrmf.cc:(.text+0x1007): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmTempFileHandler::DcmTempFileHandler(OFFilename const&) [clone .cold]':
dcistrmf.cc:(.text.unlikely+0x114): undefined reference to `OFMutex::~OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmf.cc.o): in function `DcmTempFileHandler::newInstance(OFFilename const&) [clone .cold]':
dcistrmf.cc:(.text.unlikely+0x124): undefined reference to `OFMutex::~OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmz.cc.o): in function `DcmZLibInputFilter::~DcmZLibInputFilter()':
dcistrmz.cc:(.text+0x9c): undefined reference to `inflateEnd'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmz.cc.o): in function `DcmZLibInputFilter::~DcmZLibInputFilter()':
dcistrmz.cc:(.text+0x13c): undefined reference to `inflateEnd'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmz.cc.o): in function `DcmZLibInputFilter::skip(long)':
dcistrmz.cc:(.text+0x3eb): undefined reference to `inflate'
/usr/bin/ld: dcistrmz.cc:(.text+0x49e): undefined reference to `inflate'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmz.cc.o): in function `DcmZLibInputFilter::read(void*, long)':
dcistrmz.cc:(.text+0x99b): undefined reference to `inflate'
/usr/bin/ld: dcistrmz.cc:(.text+0xb2a): undefined reference to `inflate'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmz.cc.o): in function `DcmZLibInputFilter::DcmZLibInputFilter()':
dcistrmz.cc:(.text+0xf77): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcistrmz.cc:(.text+0xf8a): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcistrmz.cc:(.text+0xfa8): undefined reference to `inflateInit_'
/usr/bin/ld: dcistrmz.cc:(.text+0x1022): undefined reference to `inflateInit2_'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmz.cc.o): in function `DcmZLibInputFilter::decompress(void const*, long)':
dcistrmz.cc:(.text+0x145d): undefined reference to `inflate'
/usr/bin/ld: dcistrmz.cc:(.text+0x14ee): undefined reference to `inflate'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmz.cc.o): in function `DcmZLibInputFilter::fillOutputBuffer()':
dcistrmz.cc:(.text+0x17a7): undefined reference to `inflate'
/usr/bin/ld: dcistrmz.cc:(.text+0x185e): undefined reference to `inflate'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmz.cc.o): in function `OFGlobal<bool>::~OFGlobal()':
dcistrmz.cc:(.text._ZN8OFGlobalIbED2Ev[_ZN8OFGlobalIbED5Ev]+0x14): undefined reference to `OFMutex::~OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmz.cc.o): in function `OFGlobal<bool>::~OFGlobal()':
dcistrmz.cc:(.text._ZN8OFGlobalIbED0Ev[_ZN8OFGlobalIbED5Ev]+0x18): undefined reference to `OFMutex::~OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcistrmz.cc.o): in function `_GLOBAL__sub_I_dcmZlibExpectRFC1950Encoding':
dcistrmz.cc:(.text.startup+0x4b): undefined reference to `OFMutex::OFMutex()'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::getLength(E_TransferSyntax, E_EncodingType)':
dcitem.cc:(.text+0x1c8e): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0x1ca1): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0x1cba): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x1cc7): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x1dc7): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x1e35): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x1e42): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x1f42): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::getParentItem()':
dcitem.cc:(.text+0x20de): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x214a): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x2153): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x224c): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x22a1): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x2390): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::insert(DcmElement*, bool, bool)':
dcitem.cc:(.text+0x254e): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x257e): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x25a2): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x25af): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x269a): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x2744): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x2768): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x2775): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x2879): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x28ac): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x28b9): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x29c0): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x2a51): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x2b3b): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x2c1e): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x2c2b): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x2cae): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x2cf2): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x2d16): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x2d23): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x2e0e): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x2e9c): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x2f68): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x2fa6): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x3094): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x30d2): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x31ca): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::searchSubFromHere(DcmTagKey const&, DcmStack&, bool)':
dcitem.cc:(.text+0x36b8): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x36c5): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x3753): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::checkAndUpdateVR(DcmItem&, DcmTag&)':
dcitem.cc:(.text+0x602d): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x60b6): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x6132): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x61b1): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x61f4): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o):dcitem.cc:(.text+0x6211): more undefined references to `dcmtk::log4cplus::Logger::isEnabledFor(int) const' follow
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::checkAndUpdateVR(DcmItem&, DcmTag&)':
dcitem.cc:(.text+0x6231): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x62ec): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x6331): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x6416): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x6459): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x653e): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x657c): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x6661): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x669f): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x6784): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x67c7): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x687d): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::computeGroupLengthAndPadding(E_GrpLenEncoding, E_PaddingEncoding, E_TransferSyntax, E_EncodingType, unsigned int, unsigned int, unsigned int)':
dcitem.cc:(.text+0xc744): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xc751): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xc7e8): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xc89b): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xcc2c): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xcc39): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xcd74): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xcff9): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xd172): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::readTagAndLength(DcmInputStream&, E_TransferSyntax, DcmTag&, unsigned int&, unsigned int&)':
dcitem.cc:(.text+0xda30): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0xda44): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0xda5e): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xda6b): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xdb01): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xdc6a): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xdc77): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xdd57): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xde60): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0xde74): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0xdeae): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xdec8): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0xdedc): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0xdf18): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0xdf2b): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0xdfb5): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xdfc2): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xe05d): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xe19f): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xe1ac): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xe2b2): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xe40f): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xe41c): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xe4b7): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xe524): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xe538): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xe65c): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xe716): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xe723): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xe7c9): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xe862): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xe876): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xe8f2): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xe973): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xea83): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::updateSpecificCharacterSet(OFCondition&, DcmSpecificCharacterSet const&)':
dcitem.cc:(.text+0xfb65): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xfb6e): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xfcf6): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xfd6a): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xfd77): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0xfedc): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0xffb5): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0xffbe): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x10090): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x100fd): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x101e7): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x102d9): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::convertCharacterSet(OFString const&, OFString const&, unsigned long, bool)':
dcitem.cc:(.text+0x104a6): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x10651): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x10851): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::newDicomElement(DcmElement*&, DcmTag&, unsigned int, DcmPrivateTagCache*, bool&)':
dcitem.cc:(.text+0x12fd0): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0x12fe7): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0x130a2): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0x130b5): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0x130cf): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x130dc): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x1318b): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x131d3): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0x131e7): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0x132f8): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x13afb): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x13be6): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x13c4e): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0x13c62): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0x13cdf): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x13cec): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x13d8b): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x13dc5): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x13dd2): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x13e9a): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x13f05): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0x13f19): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0x13f8e): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0x13fa2): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0x13fbc): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x13fc9): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x14085): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x140f2): undefined reference to `OFMutex::lock()'
/usr/bin/ld: dcitem.cc:(.text+0x14106): undefined reference to `OFMutex::unlock()'
/usr/bin/ld: dcitem.cc:(.text+0x14120): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x1412d): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x141b3): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x14225): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x14232): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x142b8): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: dcitem.cc:(.text+0x1437c): undefined reference to `dcmtk::log4cplus::Logger::isEnabledFor(int) const'
/usr/bin/ld: dcitem.cc:(.text+0x14389): undefined reference to `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()'
/usr/bin/ld: dcitem.cc:(.text+0x1443b): undefined reference to `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libdcmdata.a(dcitem.cc.o): in function `DcmItem::readSubElement(DcmInputStream&, DcmTag&, unsigned int, E_TransferSyntax, E_GrpLenEncoding, unsigned int)':

... a lot more stuff (too much for the forum) ...

collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/demo.dir/build.make:84: demo] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/demo.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
At least a new error message ;-)

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

Re: Minimal example (Linux) application using DCMTK with linking errors

#6 Post by Michael Onken »

Hey,

the order of the DCMTK libraries seems to be wrong.

Could you try to use this explicit line instead of the existing target_link_libraries() call? The last 3 active lines would look like this then:

Code: Select all

link_directories(${DCMTK_DIR}/lib)
add_executable(demo demo.cc)
target_link_libraries(demo dcmect dcmpmap dcmtract dcmseg dcmfg dcmiod dcmrt dcmpstat dcmqrdb dcmwlm dcmdsig cmr dcmsr dcmnet dcmtls dcmtkcharls dcmjpls ijg16 ijg12 ijg8 dcmjpeg dcmimage dcmimgle dcmxml i2d dcmdata oflog ofstd oficonv  z)
I also added ZLIB which is is also required by your project (since you compiled DCMTK with zlib support).

BR Michael

zardoz
Posts: 9
Joined: Mon, 2023-03-06, 09:29

Re: Minimal example (Linux) application using DCMTK with linking errors

#7 Post by zardoz »

Now only two linking errors remain:

Code: Select all

[ 50%] Building CXX object CMakeFiles/demo.dir/demo.cc.o
[100%] Linking CXX executable demo
/usr/bin/ld: cannot find -ldcmxml
/usr/bin/ld: cannot find -loficonv
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/demo.dir/build.make:84: demo] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/demo.dir/all] Error 2
make: *** [Makefile:84: all] Error
I guess because XML and builtin ICONV support is enabled

Code: Select all

// during compilation of DCMTK
...
-- Info: DCMTK XML support will be enabled
...
-- Performing Test Iconv_IS_BUILT_IN
-- Performing Test Iconv_IS_BUILT_IN - Success
-- Info: found builtin ICONV support inside the C standard library.
-- Warning: ICONV support will be disabled because libiconv was not found. Correct LIBICONV_LIBDIR and LIBICONV_INCLUDE_DIR and re-enable DCMTK_WITH_ICONV.
...
Unfortunately, just adding dcmxml and oficonv to target_link_libraries does not help.

Code: Select all

target_link_libraries(demo dcmect dcmpmap dcmtract dcmseg dcmfg dcmiod dcmrt dcmpstat dcmqrdb dcmwlm dcmdsig cmr dcmsr dcmnet dcmtls dcmtkcharls dcmjpls ijg16 ijg12 ijg8 dcmjpeg dcmimage dcmimgle dcmxml i2d dcmdata oflog ofstd oficonv  z dcmxml oficonv)

zardoz
Posts: 9
Joined: Mon, 2023-03-06, 09:29

Re: Minimal example (Linux) application using DCMTK with linking errors

#8 Post by zardoz »

I just saw that dcmxml and oficonv were already in the target_link_libraries list. So I removed them completely (as those are not present in my lib dir):

Code: Select all

target_link_libraries(demo pthread dcmect dcmpmap dcmtract dcmseg dcmfg dcmiod dcmrt dcmpstat dcmqrdb dcmwlm dcmdsig cmr dcmsr dcmnet dcmtls dcmtkcharls dcmjpls ijg16 ijg12 ijg8 dcmjpeg dcmimage dcmimgle i2d dcmdata oflog ofstd z)
Unfortunately, I now get some undefined references again (but not so many as initially):

Code: Select all

Scanning dependencies of target demo
[ 50%] Building CXX object CMakeFiles/demo.dir/demo.cc.o
[100%] Linking CXX executable demo
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(logimpl.cc.o): in function `dcmtk::log4cplus::spi::LoggerImpl::forcedLog(int, OFString const&, char const*, int)':
logimpl.cc:(.text+0x1bb): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(logimpl.cc.o): in function `dcmtk::log4cplus::spi::LoggerImpl::log(int, OFString const&, char const*, int)':
logimpl.cc:(.text+0x6a8): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(logmacro.cc.o): in function `dcmtk::log4cplus::detail::get_macro_body_oss[abi:cxx11]()':
logmacro.cc:(.text+0x170): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(logmacro.cc.o): in function `dcmtk::log4cplus::detail::get_macro_body_snprintf_buf()':
logmacro.cc:(.text+0x1c2): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(logmacro.cc.o): in function `dcmtk::log4cplus::detail::macro_forced_log(dcmtk::log4cplus::Logger const&, int, OFString const&, char const*, int, char const*)':
logmacro.cc:(.text+0x21f): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(patlay.cc.o):patlay.cc:(.text+0x412): more undefined references to `pthread_getspecific' follow
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::Semaphore::lock() const':
syncprims.cc:(.text+0xbc): undefined reference to `sem_wait'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::FairMutex::~FairMutex()':
syncprims.cc:(.text+0x101): undefined reference to `sem_destroy'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::Semaphore::unlock() const':
syncprims.cc:(.text+0x15c): undefined reference to `sem_post'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::SharedMutex::SharedMutex()':
syncprims.cc:(.text+0x1c5): undefined reference to `pthread_rwlock_init'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::SharedMutex::rdlock() const':
syncprims.cc:(.text+0x214): undefined reference to `pthread_rwlock_rdlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::SharedMutex::wrlock() const':
syncprims.cc:(.text+0x25c): undefined reference to `pthread_rwlock_wrlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::SharedMutex::rdunlock() const':
syncprims.cc:(.text+0x29c): undefined reference to `pthread_rwlock_unlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::SharedMutex::wrunlock() const':
syncprims.cc:(.text+0x2dc): undefined reference to `pthread_rwlock_unlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::FairMutex::unlock() const':
syncprims.cc:(.text+0x31c): undefined reference to `sem_post'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::Semaphore::Semaphore(unsigned int, unsigned int)':
syncprims.cc:(.text+0x398): undefined reference to `sem_init'
/usr/bin/ld: syncprims.cc:(.text+0x3ac): undefined reference to `sem_wait'
/usr/bin/ld: syncprims.cc:(.text+0x3d1): undefined reference to `sem_init'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::FairMutex::lock() const':
syncprims.cc:(.text+0x43c): undefined reference to `sem_wait'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::Mutex::Mutex(dcmtk::log4cplus::thread::Mutex::Type)':
syncprims.cc:(.text+0x5e4): undefined reference to `pthread_mutexattr_init'
/usr/bin/ld: syncprims.cc:(.text+0x5f9): undefined reference to `pthread_mutexattr_settype'
/usr/bin/ld: syncprims.cc:(.text+0x614): undefined reference to `pthread_mutexattr_destroy'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::Semaphore::~Semaphore()':
syncprims.cc:(.text+0x8d1): undefined reference to `sem_destroy'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::ManualResetEvent::ManualResetEvent(bool)':
syncprims.cc:(.text+0x987): undefined reference to `pthread_mutexattr_init'
/usr/bin/ld: syncprims.cc:(.text+0x995): undefined reference to `pthread_mutexattr_settype'
/usr/bin/ld: syncprims.cc:(.text+0x9b8): undefined reference to `pthread_mutexattr_destroy'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::FairMutex::FairMutex()':
syncprims.cc:(.text+0xbce): undefined reference to `sem_init'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::Semaphore::Semaphore(unsigned int, unsigned int) [clone .cold]':
syncprims.cc:(.text.unlikely+0xe3): undefined reference to `sem_destroy'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(syncprims.cc.o): in function `dcmtk::log4cplus::thread::impl::PthreadMutexAttr::~PthreadMutexAttr()':
syncprims.cc:(.text._ZN5dcmtk9log4cplus6thread4impl16PthreadMutexAttrD2Ev[_ZN5dcmtk9log4cplus6thread4impl16PthreadMutexAttrD5Ev]+0x9): undefined reference to `pthread_mutexattr_destroy'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `virtual thunk to dcmtk::log4cplus::thread::(anonymous namespace)::ThreadImpl::~ThreadImpl()':
threads.cc:(.text+0x165): undefined reference to `pthread_detach'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `virtual thunk to dcmtk::log4cplus::thread::(anonymous namespace)::ThreadImpl::~ThreadImpl()':
threads.cc:(.text+0x1d5): undefined reference to `pthread_detach'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::(anonymous namespace)::ThreadImpl::~ThreadImpl()':
threads.cc:(.text+0x235): undefined reference to `pthread_detach'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::(anonymous namespace)::ThreadImpl::~ThreadImpl()':
threads.cc:(.text+0x2a5): undefined reference to `pthread_detach'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::AbstractThread::start()':
threads.cc:(.text+0x2dd): undefined reference to `pthread_create'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::blockAllSignals()':
threads.cc:(.text+0x352): undefined reference to `pthread_sigmask'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::impl::ThreadStart::threadStartFuncWorker(void*)':
threads.cc:(.text+0x3cc): undefined reference to `pthread_sigmask'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::impl::Thread::~Thread()':
threads.cc:(.text+0x58d): undefined reference to `pthread_detach'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::impl::Thread::~Thread()':
threads.cc:(.text+0x645): undefined reference to `pthread_detach'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `virtual thunk to dcmtk::log4cplus::thread::impl::Thread::~Thread()':
threads.cc:(.text+0x69d): undefined reference to `pthread_detach'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::impl::Thread::start()':
threads.cc:(.text+0x6d9): undefined reference to `pthread_create'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::impl::Thread::join()':
threads.cc:(.text+0x78f): undefined reference to `pthread_join'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::AbstractThread::join() const':
threads.cc:(.text+0x960): undefined reference to `pthread_join'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::getCurrentThreadName()':
threads.cc:(.text+0xb02): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::getCurrentThreadName2()':
threads.cc:(.text+0xf12): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `dcmtk::log4cplus::thread::impl::Thread::~Thread()':
threads.cc:(.text+0x5c5): undefined reference to `pthread_detach'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(threads.cc.o): in function `virtual thunk to dcmtk::log4cplus::thread::impl::Thread::~Thread()':
threads.cc:(.text+0x5fd): undefined reference to `pthread_detach'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(timehelp.cc.o): in function `dcmtk::log4cplus::helpers::Time::getFormattedTime(OFString const&, bool) const':
timehelp.cc:(.text+0x2a2): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(appender.cc.o): in function `dcmtk::log4cplus::Appender::formatEvent(dcmtk::log4cplus::spi::InternalLoggingEvent const&) const':
appender.cc:(.text+0x9c2): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(globinit.cc.o): in function `dcmtk::log4cplus::internal::alloc_ptd()':
globinit.cc:(.text+0xdbd): undefined reference to `pthread_setspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(globinit.cc.o): in function `dcmtk::log4cplus::threadCleanup()':
globinit.cc:(.text+0x110f): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(globinit.cc.o): in function `dcmtk::log4cplus::ptd_cleanup_func(void*)':
globinit.cc:(.text+0x1162): undefined reference to `pthread_getspecific'
/usr/bin/ld: globinit.cc:(.text+0x1192): undefined reference to `pthread_setspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(globinit.cc.o): in function `(anonymous namespace)::_static_log4cplus_initializer::~_static_log4cplus_initializer()':
globinit.cc:(.text+0x11af): undefined reference to `pthread_getspecific'
/usr/bin/ld: globinit.cc:(.text+0x11dc): undefined reference to `pthread_setspecific'
/usr/bin/ld: globinit.cc:(.text+0x11eb): undefined reference to `pthread_key_delete'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(globinit.cc.o): in function `dcmtk::log4cplus::initializeLog4cplus() [clone .part.0]':
globinit.cc:(.text+0x1230): undefined reference to `pthread_key_create'
/usr/bin/ld: globinit.cc:(.text+0x123e): undefined reference to `pthread_getspecific'
/usr/bin/ld: globinit.cc:(.text+0x12c2): undefined reference to `pthread_setspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(globinit.cc.o): in function `dcmtk::log4cplus::threadCleanup()':
globinit.cc:(.text+0x113d): undefined reference to `pthread_setspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(log4judp.cc.o): in function `dcmtk::log4cplus::Log4jUdpAppender::append(dcmtk::log4cplus::spi::InternalLoggingEvent const&)':
log4judp.cc:(.text+0xd74): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(loglevel.cc.o): in function `dcmtk::log4cplus::LogLevelManager::toString(int) const':
loglevel.cc:(.text+0x374): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(mdc.cc.o): in function `dcmtk::log4cplus::MDC::getPtr()':
mdc.cc:(.text+0x42): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(mdc.cc.o): in function `dcmtk::log4cplus::MDC::clear()':
mdc.cc:(.text+0x9c): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(mdc.cc.o): in function `dcmtk::log4cplus::MDC::put(OFString const&, OFString const&)':
mdc.cc:(.text+0x3d2): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/liboflog.a(mdc.cc.o):mdc.cc:(.text+0x6cc): more undefined references to `pthread_getspecific' follow
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::getLocaleEncoding()':
ofchrenc.cc:(.text+0x4a3): undefined reference to `ucnv_open_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x4e7): undefined reference to `ucnv_getName_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x4fa): undefined reference to `ucnv_close_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::~OFCharacterEncoding()':
ofchrenc.cc:(.text+0x5cb): undefined reference to `ucnv_close_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x5d4): undefined reference to `ucnv_close_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::operator=(OFCharacterEncoding const&)':
ofchrenc.cc:(.text+0x650): undefined reference to `ucnv_close_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x65a): undefined reference to `ucnv_close_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o):ofchrenc.cc:(.text+0x73b): more undefined references to `ucnv_close_66' follow
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::getConversionFlags() const':
ofchrenc.cc:(.text+0x7c8): undefined reference to `ucnv_getFromUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x7d4): undefined reference to `UCNV_FROM_U_CALLBACK_STOP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x7dd): undefined reference to `UCNV_FROM_U_CALLBACK_SKIP_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::setConversionFlags(unsigned int)':
ofchrenc.cc:(.text+0x858): undefined reference to `UCNV_FROM_U_CALLBACK_SKIP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x86c): undefined reference to `ucnv_setFromUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x8f7): undefined reference to `UCNV_FROM_U_CALLBACK_STOP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x90b): undefined reference to `ucnv_setFromUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x91e): undefined reference to `UCNV_TO_U_CALLBACK_STOP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x930): undefined reference to `ucnv_setToUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x963): undefined reference to `UCNV_TO_U_CALLBACK_SKIP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x975): undefined reference to `ucnv_setToUCallBack_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::selectEncoding(OFString const&, OFString const&)':
ofchrenc.cc:(.text+0xa05): undefined reference to `ucnv_open_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xa17): undefined reference to `UCNV_TO_U_CALLBACK_STOP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xa29): undefined reference to `ucnv_setToUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xa52): undefined reference to `ucnv_open_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xa69): undefined reference to `ucnv_close_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xa72): undefined reference to `u_errorName_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xb31): undefined reference to `ucnv_close_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xb3a): undefined reference to `ucnv_close_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xbd3): undefined reference to `UCNV_FROM_U_CALLBACK_STOP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xbe5): undefined reference to `ucnv_setFromUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xbf5): undefined reference to `ucnv_close_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::Implementation::convert(OFString&, char const*, unsigned long)':
ofchrenc.cc:(.text._ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm[_ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm]+0x115): undefined reference to `ucnv_convertEx_66'
/usr/bin/ld: ofchrenc.cc:(.text._ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm[_ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm]+0x18f): undefined reference to `ucnv_convertEx_66'
/usr/bin/ld: ofchrenc.cc:(.text._ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm[_ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm]+0x1b4): undefined reference to `u_errorName_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFThread::start()':
ofthread.cc:(.text+0x94): undefined reference to `pthread_create'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFThread::join()':
ofthread.cc:(.text+0xf8): undefined reference to `pthread_join'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFThreadSpecificData::OFThreadSpecificData()':
ofthread.cc:(.text+0x217): undefined reference to `pthread_key_create'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFThreadSpecificData::get(void*&)':
ofthread.cc:(.text+0x2c3): undefined reference to `pthread_getspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFSemaphore::OFSemaphore(unsigned int)':
ofthread.cc:(.text+0x38b): undefined reference to `sem_init'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFSemaphore::~OFSemaphore()':
ofthread.cc:(.text+0x3d1): undefined reference to `sem_destroy'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFSemaphore::wait()':
ofthread.cc:(.text+0x421): undefined reference to `sem_wait'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFSemaphore::trywait()':
ofthread.cc:(.text+0x451): undefined reference to `sem_trywait'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFSemaphore::post()':
ofthread.cc:(.text+0x481): undefined reference to `sem_post'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLock::OFReadWriteLock()':
ofthread.cc:(.text+0x6d7): undefined reference to `pthread_rwlock_init'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLock::~OFReadWriteLock()':
ofthread.cc:(.text+0x721): undefined reference to `pthread_rwlock_destroy'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLocker::rdlock()':
ofthread.cc:(.text+0x8f4): undefined reference to `pthread_rwlock_rdlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLocker::wrlock()':
ofthread.cc:(.text+0x934): undefined reference to `pthread_rwlock_wrlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLocker::tryrdlock()':
ofthread.cc:(.text+0x974): undefined reference to `pthread_rwlock_tryrdlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLocker::trywrlock()':
ofthread.cc:(.text+0x9b4): undefined reference to `pthread_rwlock_trywrlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLocker::unlock()':
ofthread.cc:(.text+0x9f4): undefined reference to `pthread_rwlock_unlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFThreadSpecificData::set(void*)':
ofthread.cc:(.text+0x29f): undefined reference to `pthread_setspecific'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFMutex::trylock()':
ofthread.cc:(.text+0x5fd): undefined reference to `pthread_mutex_trylock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLock::rdlock()':
ofthread.cc:(.text+0x76d): undefined reference to `pthread_rwlock_rdlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLock::wrlock()':
ofthread.cc:(.text+0x78d): undefined reference to `pthread_rwlock_wrlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLock::tryrdlock()':
ofthread.cc:(.text+0x7ad): undefined reference to `pthread_rwlock_tryrdlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLock::trywrlock()':
ofthread.cc:(.text+0x7cd): undefined reference to `pthread_rwlock_trywrlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLock::rdunlock()':
ofthread.cc:(.text+0x7ed): undefined reference to `pthread_rwlock_unlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLock::wrunlock()':
ofthread.cc:(.text+0x80d): undefined reference to `pthread_rwlock_unlock'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofthread.cc.o): in function `OFReadWriteLocker::~OFReadWriteLocker()':
ofthread.cc:(.text+0x8c9): undefined reference to `pthread_rwlock_unlock'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/demo.dir/build.make:84: demo] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/demo.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

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

Re: Minimal example (Linux) application using DCMTK with linking errors

#9 Post by Michael Onken »

Hm,

here is my CMakeLists.txt that works for me:

Code: Select all

# CMakeLists.txt

project(DCMTK_DEMO)
cmake_minimum_required(VERSION 3.16)

# specify DCMTK's (default) installation directory
#set(DCMTK_DIR "/workspace/dcmtk-3.6.7-install")
#set(DCMTK_DIR "/workspace/dcmtk-3.6.7-install/usr/local/lib/cmake/dcmtk")

set(DCMTK_DIR "/home/michael/b/dcmtk_linux")

# use find_package() to search for installed DCMTK
find_package(DCMTK REQUIRED CONFIG)

# declare include directories
include_directories(${DCMTK_INCLUDE_DIRS})

# declare executable and link required libraries
link_directories(${DCMTK_DIR}/lib)
add_executable(demo demo.cc)
target_link_libraries(demo dcmect dcmpmap dcmtract dcmseg dcmfg dcmiod dcmrt dcmpstat dcmqrdb dcmwlm dcmdsig cmr dcmsr dcmnet dcmtls dcmtkcharls dcmjpls ijg16 ijg12 ijg8 dcmjpeg dcmimage dcmimgle dcmxml i2d dcmdata oflog ofstd oficonv z)
(note that I changed the DCMTK dir to my own build directory).

P.S: I think something with the find_package() does not work. Insteasd it should also be possible to not use find_package() and instead
  1. (Install DCMTK via make install to some directory, e.g. /tmp/dcmtk)
  2. add the DCMTK include directory: include_directories(/tmp/dcmtk/include)
  3. add the DCMTK library directory: link_directories(/tmp/dcmtk/lib)
  4. add DCMTK libraries to all binaries, e.g. target_link_libraries(demo dcmect dcmpmap dcmtract dcmseg dcmfg dcmiod dcmrt dcmpstat dcmqrdb dcmwlm dcmdsig cmr dcmsr dcmnet dcmtls dcmtkcharls dcmjpls ijg16 ijg12 ijg8 dcmjpeg dcmimage dcmimgle dcmxml i2d dcmdata oflog ofstd oficonv z).
use target_link_libraries as listed above for each binary..

zardoz
Posts: 9
Joined: Mon, 2023-03-06, 09:29

Re: Minimal example (Linux) application using DCMTK with linking errors

#10 Post by zardoz »

Hm, that's strange. I use a fresh Ubuntu 20.04 install inside a (GitPod cloud IDE) Docker image and compile DCMTK with the default options (full output of compilation below).

Code: Select all

-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Info: DCMTK TIFF support will be enabled
-- Info: DCMTK PNG support will be enabled
-- Performing Test OPENSSL_VERSION_CHECK
-- Performing Test OPENSSL_VERSION_CHECK - Success
-- Info: DCMTK OPENSSL support will be enabled
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Info: DCMTK XML support will be enabled
-- Info: DCMTK ZLIB support will be enabled
-- Warning: SNDFILE support will be disabled because libsndfile was not found.
-- Performing Test Iconv_IS_BUILT_IN
-- Performing Test Iconv_IS_BUILT_IN - Success
-- Info: found builtin ICONV support inside the C standard library.
-- Warning: ICONV support will be disabled because libiconv was not found. Correct LIBICONV_LIBDIR and LIBICONV_INCLUDE_DIR and re-enable DCMTK_WITH_ICONV.
-- Warning: WRAP support will be disabled because libwrap was not found.
-- Warning: OpenJPEG support will be disabled because the OpenJPEG library was not found.
-- Info: DCMTK ICU support will be enabled
-- Warning: DOXYGEN support will be disabled because doxygen was not found.
-- Performing Test LIBICONV_SECOND_ARGUMENT_CONST
-- Performing Test LIBICONV_SECOND_ARGUMENT_CONST - Failed
-- Info: DCMTK will compile with external default dictionary
-- Info: DCMTK will load dictionaries defined by DCMDICTPATH environment variable
-- Info: DCMTK's builtin private dictionary support will be disabled
-- Info: Thread support will be enabled
-- Info: Wide char file I/O functions will be disabled
-- Info: Wide char main function for command line tools will be disabled
-- Info: Building DCMTK with character set conversion support using the ICU
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of char
-- Check size of char - done
-- Check size of double
-- Check size of double - done
-- Check size of float
-- Check size of float - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of short
-- Check size of short - done
-- Check size of void*
-- Check size of void* - done
-- Looking for __FUNCTION__
-- Looking for __FUNCTION__ - found
-- Looking for __FUNCTION__
-- Looking for __FUNCTION__ - found
-- Looking for __PRETTY_FUNCTION__
-- Looking for __PRETTY_FUNCTION__ - found
-- Looking for __PRETTY_FUNCTION__
-- Looking for __PRETTY_FUNCTION__ - found
-- Looking for __func__
-- Looking for __func__ - found
-- Looking for __func__
-- Looking for __func__ - found
-- Looking for C++ include errno.h
-- Looking for C++ include errno.h - found
-- Looking for C++ include dirent.h
-- Looking for C++ include dirent.h - found
-- Looking for C++ include fcntl.h
-- Looking for C++ include fcntl.h - found
-- Looking for C++ include fstream
-- Looking for C++ include fstream - found
-- Looking for C++ include fstream.h
-- Looking for C++ include fstream.h - not found
-- Looking for C++ include fnmatch.h
-- Looking for C++ include fnmatch.h - found
-- Looking for C++ include float.h
-- Looking for C++ include float.h - found
-- Looking for C++ include grp.h
-- Looking for C++ include grp.h - found
-- Looking for C++ include malloc.h
-- Looking for C++ include malloc.h - found
-- Looking for C++ include math.h
-- Looking for C++ include math.h - found
-- Looking for C++ include cmath
-- Looking for C++ include cmath - found
-- Looking for C++ include ieeefp.h
-- Looking for C++ include ieeefp.h - not found
-- Looking for C++ include inttypes.h
-- Looking for C++ include inttypes.h - found
-- Looking for C++ include iomanip
-- Looking for C++ include iomanip - found
-- Looking for C++ include iomanip.h
-- Looking for C++ include iomanip.h - not found
-- Looking for C++ include iostream
-- Looking for C++ include iostream - found
-- Looking for C++ include iostream.h
-- Looking for C++ include iostream.h - not found
-- Looking for C++ include io.h
-- Looking for C++ include io.h - not found
-- Looking for C++ include iso646.h
-- Looking for C++ include iso646.h - found
-- Looking for C++ include png.h
-- Looking for C++ include png.h - found
-- Looking for C++ include limits.h
-- Looking for C++ include limits.h - found
-- Looking for C++ include climits
-- Looking for C++ include climits - found
-- Looking for C++ include locale.h
-- Looking for C++ include locale.h - found
-- Looking for C++ include ndir.h
-- Looking for C++ include ndir.h - not found
-- Looking for C++ include netdb.h
-- Looking for C++ include netdb.h - found
-- Looking for C++ include new.h
-- Looking for C++ include new.h - not found
-- Looking for C++ include pwd.h
-- Looking for C++ include pwd.h - found
-- Looking for C++ include semaphore.h
-- Looking for C++ include semaphore.h - found
-- Looking for C++ include setjmp.h
-- Looking for C++ include setjmp.h - found
-- Looking for C++ include sstream
-- Looking for C++ include sstream - found
-- Looking for C++ include sstream.h
-- Looking for C++ include sstream.h - not found
-- Looking for C++ include stat.h
-- Looking for C++ include stat.h - not found
-- Looking for C++ include stdbool.h
-- Looking for C++ include stdbool.h - found
-- Looking for C++ include cstddef
-- Looking for C++ include cstddef - found
-- Looking for C++ include cstdint
-- Looking for C++ include cstdint - found
-- Looking for C++ include stdio.h
-- Looking for C++ include stdio.h - found
-- Looking for C++ include cstdio
-- Looking for C++ include cstdio - found
-- Looking for C++ include streambuf.h
-- Looking for C++ include streambuf.h - not found
-- Looking for C++ include strings.h
-- Looking for C++ include strings.h - found
-- Looking for C++ include string.h
-- Looking for C++ include string.h - found
-- Looking for C++ include strstream.h
-- Looking for C++ include strstream.h - not found
-- Looking for C++ include strstream
-- Looking for C++ include strstream - found
-- Looking for C++ include strstrea.h
-- Looking for C++ include strstrea.h - not found
-- Looking for C++ include synch.h
-- Looking for C++ include synch.h - not found
-- Looking for C++ include syslog.h
-- Looking for C++ include syslog.h - found
-- Looking for C++ include sys/errno.h
-- Looking for C++ include sys/errno.h - found
-- Looking for C++ include sys/dir.h
-- Looking for C++ include sys/dir.h - found
-- Looking for C++ include sys/file.h
-- Looking for C++ include sys/file.h - found
-- Looking for C++ include sys/ndir.h
-- Looking for C++ include sys/ndir.h - not found
-- Looking for C++ include sys/param.h
-- Looking for C++ include sys/param.h - found
-- Looking for C++ include sys/resource.h
-- Looking for C++ include sys/resource.h - found
-- Looking for C++ include sys/select.h
-- Looking for C++ include sys/select.h - found
-- Looking for C++ include sys/syscall.h
-- Looking for C++ include sys/syscall.h - found
-- Looking for C++ include sys/systeminfo.h
-- Looking for C++ include sys/systeminfo.h - not found
-- Looking for C++ include sys/time.h
-- Looking for C++ include sys/time.h - found
-- Looking for C++ include sys/timeb.h
-- Looking for C++ include sys/timeb.h - found
-- Looking for C++ include sys/utime.h
-- Looking for C++ include sys/utime.h - not found
-- Looking for C++ include sys/utsname.h
-- Looking for C++ include sys/utsname.h - found
-- Looking for C++ include sys/wait.h
-- Looking for C++ include sys/wait.h - found
-- Looking for C++ include sys/socket.h
-- Looking for C++ include sys/socket.h - found
-- Looking for C++ include thread.h
-- Looking for C++ include thread.h - not found
-- Looking for C++ include process.h
-- Looking for C++ include process.h - not found
-- Looking for C++ include sys/stat.h
-- Looking for C++ include sys/stat.h - found
-- Looking for C++ include time.h
-- Looking for C++ include time.h - found
-- Looking for C++ include unistd.h
-- Looking for C++ include unistd.h - found
-- Looking for C++ include unix.h
-- Looking for C++ include unix.h - not found
-- Looking for C++ include utime.h
-- Looking for C++ include utime.h - found
-- Looking for C++ include wchar.h
-- Looking for C++ include wchar.h - found
-- Looking for C++ include wctype.h
-- Looking for C++ include wctype.h - found
-- Looking for C++ include alloca.h
-- Looking for C++ include alloca.h - found
-- Looking for C++ include arpa/inet.h
-- Looking for C++ include arpa/inet.h - found
-- Looking for C++ include ctype.h
-- Looking for C++ include ctype.h - found
-- Looking for C++ include memory.h
-- Looking for C++ include memory.h - found
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for C++ include libc.h
-- Looking for C++ include libc.h - not found
-- Looking for C++ include stdlib.h
-- Looking for C++ include stdlib.h - found
-- Looking for C++ include stdarg.h
-- Looking for C++ include stdarg.h - found
-- Looking for C++ include cstdarg
-- Looking for C++ include cstdarg - found
-- Looking for C++ include signal.h
-- Looking for C++ include signal.h - found
-- Looking for C++ include fenv.h
-- Looking for C++ include fenv.h - found
-- Looking for C++ include iterator
-- Looking for C++ include iterator - found
-- Looking for C++ include poll.h
-- Looking for C++ include poll.h - found
-- Looking for include files sys/types.h, netinet/in_systm.h
-- Looking for include files sys/types.h, netinet/in_systm.h - found
-- Looking for 3 include files sys/types.h, ..., netinet/in.h
-- Looking for 3 include files sys/types.h, ..., netinet/in.h - found
-- Looking for 4 include files sys/types.h, ..., netinet/tcp.h
-- Looking for 4 include files sys/types.h, ..., netinet/tcp.h - found
-- Looking for connect
-- Looking for connect - found
-- Looking for accept
-- Looking for accept - found
-- Looking for access
-- Looking for access - found
-- Looking for atoll
-- Looking for atoll - found
-- Looking for bcmp
-- Looking for bcmp - found
-- Looking for bcopy
-- Looking for bcopy - found
-- Looking for bind
-- Looking for bind - found
-- Looking for cuserid
-- Looking for cuserid - found
-- Looking for _doprnt
-- Looking for _doprnt - not found
-- Looking for finite
-- Looking for finite - found
-- Looking for flock
-- Looking for flock - found
-- Looking for fork
-- Looking for fork - found
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for ftime
-- Looking for ftime - found
-- Looking for getaddrinfo
-- Looking for getaddrinfo - found
-- Looking for getenv
-- Looking for getenv - found
-- Looking for geteuid
-- Looking for geteuid - found
-- Looking for getgrnam
-- Looking for getgrnam - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for gethostbyname_r
-- Looking for gethostbyname_r - found
-- Looking for gethostbyaddr_r
-- Looking for gethostbyaddr_r - found
-- Looking for gethostname
-- Looking for gethostname - found
-- Looking for gethostid
-- Looking for gethostid - found
-- Looking for getlogin
-- Looking for getlogin - found
-- Looking for getlogin_r
-- Looking for getlogin_r - found
-- Looking for getpid
-- Looking for getpid - found
-- Looking for getpwnam
-- Looking for getpwnam - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for getsockname
-- Looking for getsockname - found
-- Looking for getsockopt
-- Looking for getsockopt - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for getuid
-- Looking for getuid - found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for index
-- Looking for index - found
-- Looking for isinf
-- Looking for isinf - found
-- Looking for isnan
-- Looking for isnan - found
-- Looking for itoa
-- Looking for itoa - not found
-- Looking for listen
-- Looking for listen - found
-- Looking for localtime_r
-- Looking for localtime_r - found
-- Looking for lockf
-- Looking for lockf - found
-- Looking for lstat
-- Looking for lstat - found
-- Looking for malloc_debug
-- Looking for malloc_debug - not found
-- Looking for mbstowcs
-- Looking for mbstowcs - found
-- Looking for wcstombs
-- Looking for wcstombs - found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Looking for mktemp
-- Looking for mktemp - found
-- Looking for rindex
-- Looking for rindex - found
-- Looking for select
-- Looking for select - found
-- Looking for setsockopt
-- Looking for setsockopt - found
-- Looking for setuid
-- Looking for setuid - found
-- Looking for sleep
-- Looking for sleep - found
-- Looking for socket
-- Looking for socket - found
-- Looking for stat
-- Looking for stat - found
-- Looking for strchr
-- Looking for strchr - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strlcat
-- Looking for strlcat - not found
-- Looking for strlcpy
-- Looking for strlcpy - not found
-- Looking for strstr
-- Looking for strstr - found
-- Looking for strtoul
-- Looking for strtoul - found
-- Looking for sysinfo
-- Looking for sysinfo - found
-- Looking for tempnam
-- Looking for tempnam - found
-- Looking for tmpnam
-- Looking for tmpnam - found
-- Looking for uname
-- Looking for uname - found
-- Looking for usleep
-- Looking for usleep - found
-- Looking for wait3
-- Looking for wait3 - found
-- Looking for waitpid
-- Looking for waitpid - found
-- Looking for _findfirst
-- Looking for _findfirst - not found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for prototype of feenableexcept
-- Looking for prototype of feenableexcept - found
-- Looking for prototype of isinf(0.)
-- Looking for prototype of isinf(0.) - found
-- Looking for prototype of isnan(0.)
-- Looking for prototype of isnan(0.) - found
-- Looking for prototype of finite
-- Looking for prototype of finite - found
-- Looking for prototype of std::isinf(0.)
-- Looking for prototype of std::isinf(0.) - found
-- Looking for prototype of std::isnan(0.)
-- Looking for prototype of std::isnan(0.) - found
-- Looking for prototype of std::finite
-- Looking for prototype of std::finite - not found.
-- Looking for prototype of flock
-- Looking for prototype of flock - found
-- Looking for prototype of gethostbyname
-- Looking for prototype of gethostbyname - found
-- Looking for prototype of gethostbyname_r
-- Looking for prototype of gethostbyname_r - found
-- Looking for prototype of gethostbyaddr_r
-- Looking for prototype of gethostbyaddr_r - found
-- Looking for prototype of gethostid
-- Looking for prototype of gethostid - found
-- Looking for prototype of gethostname
-- Looking for prototype of gethostname - found
-- Looking for prototype of waitpid
-- Looking for prototype of waitpid - found
-- Looking for prototype of wait3
-- Looking for prototype of wait3 - found
-- Looking for prototype of usleep
-- Looking for prototype of usleep - found
-- Looking for prototype of accept
-- Looking for prototype of accept - found
-- Looking for prototype of bind
-- Looking for prototype of bind - found
-- Looking for prototype of getsockname
-- Looking for prototype of getsockname - found
-- Looking for prototype of getsockopt
-- Looking for prototype of getsockopt - found
-- Looking for prototype of setsockopt
-- Looking for prototype of setsockopt - found
-- Looking for prototype of socket
-- Looking for prototype of socket - found
-- Looking for prototype of listen
-- Looking for prototype of listen - found
-- Looking for prototype of _vsnprintf_s
-- Looking for prototype of _vsnprintf_s - not found.
-- Looking for prototype of vfprintf_s
-- Looking for prototype of vfprintf_s - not found.
-- Looking for prototype of vprintf
-- Looking for prototype of vprintf - found
-- Looking for prototype of vsnprintf
-- Looking for prototype of vsnprintf - found
-- Looking for prototype of vsprintf_s
-- Looking for prototype of vsprintf_s - not found.
-- Looking for prototype of std::vfprintf
-- Looking for prototype of std::vfprintf - found
-- Looking for prototype of std::vsnprintf
-- Looking for prototype of std::vsnprintf - found
-- Looking for prototype of _stricmp
-- Looking for prototype of _stricmp - not found.
-- Looking for prototype of socklen_t definition
-- Looking for prototype of socklen_t definition - found
-- Looking for prototype of gettimeofday
-- Looking for prototype of gettimeofday - found
-- Looking for prototype of connect
-- Looking for prototype of connect - found
-- Looking for prototype of mkstemp
-- Looking for prototype of mkstemp - found
-- Looking for prototype of mktemp
-- Looking for prototype of mktemp - found
-- Looking for prototype of memcmp
-- Looking for prototype of memcmp - found
-- Looking for prototype of memcpy
-- Looking for prototype of memcpy - found
-- Looking for prototype of memset
-- Looking for prototype of memset - found
-- Looking for prototype of select
-- Looking for prototype of select - found
-- Looking for prototype of strcasecmp
-- Looking for prototype of strcasecmp - found
-- Looking for prototype of strncasecmp
-- Looking for prototype of strncasecmp - found
-- Looking for prototype of strerror_r
-- Looking for prototype of strerror_r - found
-- Looking for prototype of SYS_gettid
-- Looking for prototype of SYS_gettid - found
-- Looking for prototype of std::ios_base::openmode definition
-- Looking for prototype of std::ios_base::openmode definition - not found.
-- Looking for prototype of pthread_rwlock_init
-- Looking for prototype of pthread_rwlock_init - found
-- Looking for prototype of __sync_add_and_fetch((int*)0,0)
-- Looking for prototype of __sync_add_and_fetch((int*)0,0) - found
-- Looking for prototype of __sync_sub_and_fetch((int*)0,0)
-- Looking for prototype of __sync_sub_and_fetch((int*)0,0) - found
-- Looking for prototype of InterlockedIncrement((long*)0)
-- Looking for prototype of InterlockedIncrement((long*)0) - not found.
-- Looking for prototype of InterlockedDecrement((long*)0)
-- Looking for prototype of InterlockedDecrement((long*)0) - not found.
-- Looking for prototype of _fpclassf(0.0f)
-- Looking for prototype of _fpclassf(0.0f) - not found.
-- Looking for prototype of getgrnam_r((char*)0,(group*)0,(char*)0,0,(group**)0)
-- Looking for prototype of getgrnam_r((char*)0,(group*)0,(char*)0,0,(group**)0) - found
-- Looking for prototype of getpwnam_r((char*)0,(passwd*)0,(char*)0,0,(passwd**)0)
-- Looking for prototype of getpwnam_r((char*)0,(passwd*)0,(char*)0,0,(passwd**)0) - found
-- Looking for prototype of readdir_r((DIR*)0,(dirent*)0,(dirent**)0)
-- Looking for prototype of readdir_r((DIR*)0,(dirent*)0,(dirent**)0) - found
-- Looking for prototype of readdir_r((DIR*)0,(dirent*)0)
-- Looking for prototype of readdir_r((DIR*)0,(dirent*)0) - not found.
-- Looking for prototype of nanosleep
-- Looking for prototype of nanosleep - found
-- Looking for prototype of &passwd::pw_gecos
-- Looking for prototype of &passwd::pw_gecos - found
-- Looking for prototype of TryAcquireSRWLockShared((PSRWLOCK)0)
-- Looking for prototype of TryAcquireSRWLockShared((PSRWLOCK)0) - not found.
-- Looking for prototype of fp_except_t definition
-- Looking for prototype of fp_except_t definition - not found.
-- Looking for prototype of uchar definition
-- Looking for prototype of uchar definition - not found.
-- Looking for prototype of ushort definition
-- Looking for prototype of ushort definition - found
-- Looking for prototype of uint definition
-- Looking for prototype of uint definition - found
-- Looking for prototype of ulong definition
-- Looking for prototype of ulong definition - found
-- Looking for prototype of longlong definition
-- Looking for prototype of longlong definition - not found.
-- Looking for prototype of ulonglong definition
-- Looking for prototype of ulonglong definition - not found.
-- Looking for prototype of long long definition
-- Looking for prototype of long long definition - found
-- Looking for prototype of unsigned long long definition
-- Looking for prototype of unsigned long long definition - found
-- Looking for prototype of int64_t definition
-- Looking for prototype of int64_t definition - found
-- Looking for prototype of uint64_t definition
-- Looking for prototype of uint64_t definition - found
-- Looking for prototype of char16_t definition
-- Looking for prototype of char16_t definition - found
-- Looking for prototype of fpos64_t definition
-- Looking for prototype of fpos64_t definition - found
-- Looking for prototype of off64_t definition
-- Looking for prototype of off64_t definition - found
-- Looking for prototype of popen
-- Looking for prototype of popen - found
-- Looking for prototype of pclose
-- Looking for prototype of pclose - found
-- Looking for prototype of sigjmp_buf definition
-- Looking for prototype of sigjmp_buf definition - found
-- Checking whether <math.h> can be included as extern "C"
-- Checking whether <math.h> can be included as extern "C" -- yes
-- Checking signedness of char
-- Checking whether char is signed
-- Checking whether char is signed -- yes
-- Checking signedness of char -- signed
-- Checking whether pthread_t is an integer type
-- Checking whether pthread_t is an integer type -- yes
-- Checking whether typename works correctly
-- Checking whether typename works correctly -- yes
-- Checking whether ENAMETOOLONG is defined
-- Checking whether ENAMETOOLONG is defined -- yes
-- Checking whether strerror_r returns an int
-- Checking whether strerror_r returns an int -- no
-- Checking whether variable length arrays are supported
-- Checking whether variable length arrays are supported -- yes
-- Checking whether std::ios::nocreate exists
-- Checking whether std::ios::nocreate exists -- no
-- Checking whether explicit large file support (LFS64) is available
-- Checking whether explicit large file support (LFS64) is available -- yes
-- Info: Building DCMTK with explicit large file support (LFS64)
-- Checking whether socket functions accept an int* argument
-- Checking whether socket functions accept an int* argument -- no
-- Checking whether select() accepts an int* argument
-- Checking whether select() accepts an int* argument -- no
-- Checking whether __alignof__ is supported
-- Checking whether __alignof__ is supported -- yes
-- Checking whether __alignof is supported
-- Checking whether __alignof is supported -- yes
-- Checking whether __attribute__((aligned)) is supported
-- Checking whether __attribute__((aligned)) is supported -- yes
-- Checking whether __attribute__((aligned)) supports templates
-- Checking whether __attribute__((aligned)) supports templates -- yes
-- Checking whether __declspec(align) is supported
-- Checking whether __declspec(align) is supported -- no
-- Checking whether the compiler supports default constructor detection via SFINAE
-- Checking whether the compiler supports default constructor detection via SFINAE -- yes
-- Checking whether ANSI standard C++ includes use std namespace
-- Checking whether ANSI standard C++ includes use std namespace -- yes
-- Checking whether the compiler supports std::nothrow
-- Checking whether the compiler supports std::nothrow -- yes
-- Checking whether the compiler supports operator delete (std::nothrow)
-- Checking whether the compiler supports operator delete (std::nothrow) -- yes
-- Checking whether the compiler supports static_assert
-- Checking whether the compiler supports static_assert -- yes
-- Checking whether the compiler supports [[deprecated]]
-- Checking whether the compiler supports [[deprecated]] -- yes
-- Checking whether the compiler supports [[deprecated("message")]]
-- Checking whether the compiler supports [[deprecated("message")]] -- yes
-- Checking whether the compiler supports __attribute__((deprecated))
-- Checking whether the compiler supports __attribute__((deprecated)) -- yes
-- Checking whether the compiler supports __attribute__((deprecated("message")))
-- Checking whether the compiler supports __attribute__((deprecated("message"))) -- yes
-- Checking whether the compiler supports __declspec(deprecated)
-- Checking whether the compiler supports __declspec(deprecated) -- no
-- Checking whether the compiler supports __declspec(deprecated("message"))
-- Checking whether the compiler supports __declspec(deprecated("message")) -- no
-- Checking whether the iterator category input is declared
-- Checking whether the iterator category input is declared -- yes
-- Checking whether the iterator category output is declared
-- Checking whether the iterator category output is declared -- yes
-- Checking whether the iterator category forward is declared
-- Checking whether the iterator category forward is declared -- yes
-- Checking whether the iterator category bidirectional is declared
-- Checking whether the iterator category bidirectional is declared -- yes
-- Checking whether the iterator category random_access is declared
-- Checking whether the iterator category random_access is declared -- yes
-- Checking whether the iterator category contiguous is declared
-- Checking whether the iterator category contiguous is declared -- no
-- Detecting fixed iconv conversion flags
-- Detecting fixed iconv conversion flags - AbortTranscodingOnIllegalSequence
-- Checking whether iconv_open() accepts "" as an argument
-- Checking whether iconv_open() accepts "" as an argument - yes
-- Checking whether pw_gecos is #defined to pw_passwd
-- Checking whether pw_gecos is #defined to pw_passwd -- no
-- Info: C++11 features disabled
-- Info: C++14 features disabled
-- Info: C++17 features disabled
-- Info: STL vector support disabled
-- Info: STL algorithm support disabled
-- Info: STL limits support disabled
-- Info: STL list support disabled
-- Info: STL map support disabled
-- Info: STL memory support disabled
-- Info: STL stack support disabled
-- Info: STL string support disabled
-- Info: STL type_traits support disabled
-- Info: STL tuple support disabled
-- Info: STL system_error support disabled
-- Looking for pthread_key_create in pthread
-- Looking for pthread_key_create in pthread - found
-- Looking for sem_init in rt
-- Looking for sem_init in rt - not found
-- Looking for C++ include openssl/provider.h
-- Looking for C++ include openssl/provider.h - not found
-- Looking for prototype of SSL_CTX_get0_param
-- Looking for prototype of SSL_CTX_get0_param - found
-- Looking for prototype of RAND_egd
-- Looking for prototype of RAND_egd - not found.
-- Looking for prototype of DH_bits
-- Looking for prototype of DH_bits - found
-- Looking for prototype of EVP_PKEY_RSA_PSS
-- Looking for prototype of EVP_PKEY_RSA_PSS - found
-- Looking for prototype of EVP_PKEY_base_id
-- Looking for prototype of EVP_PKEY_base_id - found
-- Looking for prototype of SSL_CTX_get_cert_store
-- Looking for prototype of SSL_CTX_get_cert_store - found
-- Looking for prototype of SSL_CTX_get_ciphers
-- Looking for prototype of SSL_CTX_get_ciphers - found
-- Looking for prototype of SSL_CTX_set0_tmp_dh_pkey
-- Looking for prototype of SSL_CTX_set0_tmp_dh_pkey - not found.
-- Looking for prototype of SSL_CTX_set1_curves(0,0,0)
-- Looking for prototype of SSL_CTX_set1_curves(0,0,0) - found
-- Looking for prototype of SSL_CTX_set1_sigalgs
-- Looking for prototype of SSL_CTX_set1_sigalgs - not found.
-- Looking for prototype of SSL_CTX_set_ecdh_auto(0,0)
-- Looking for prototype of SSL_CTX_set_ecdh_auto(0,0) - found
-- Looking for prototype of SSL_CTX_set_max_proto_version(0,0)
-- Looking for prototype of SSL_CTX_set_max_proto_version(0,0) - found
-- Looking for prototype of SSL_CTX_set_security_level
-- Looking for prototype of SSL_CTX_set_security_level - found
-- Looking for prototype of SSL_ERROR_WANT_ASYNC
-- Looking for prototype of SSL_ERROR_WANT_ASYNC - found
-- Looking for prototype of SSL_ERROR_WANT_ASYNC_JOB
-- Looking for prototype of SSL_ERROR_WANT_ASYNC_JOB - found
-- Looking for prototype of SSL_ERROR_WANT_CLIENT_HELLO_CB
-- Looking for prototype of SSL_ERROR_WANT_CLIENT_HELLO_CB - found
-- Looking for prototype of TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305
-- Looking for prototype of TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305 - found
-- Looking for prototype of TLS_method
-- Looking for prototype of TLS_method - found
-- Looking for prototype of X509_STORE_get0_param
-- Looking for prototype of X509_STORE_get0_param - found
-- Looking for prototype of X509_get_signature_nid
-- Looking for prototype of X509_get_signature_nid - found
-- Looking for prototype of ASN1_STRING_get0_data
-- Looking for prototype of ASN1_STRING_get0_data - found
-- Looking for prototype of EVP_PKEY_get0_EC_KEY
-- Looking for prototype of EVP_PKEY_get0_EC_KEY - found
-- Looking for prototype of EVP_PKEY_get_group_name
-- Looking for prototype of EVP_PKEY_get_group_name - not found.
-- Looking for prototype of EVP_PKEY_id
-- Looking for prototype of EVP_PKEY_id - found
-- Looking for prototype of OSSL_PROVIDER_load
-- Looking for prototype of OSSL_PROVIDER_load - not found.
-- Looking for prototype of TS_STATUS_INFO_get0_failure_info
-- Looking for prototype of TS_STATUS_INFO_get0_failure_info - found
-- Looking for prototype of TS_STATUS_INFO_get0_status
-- Looking for prototype of TS_STATUS_INFO_get0_status - found
-- Looking for prototype of TS_STATUS_INFO_get0_text
-- Looking for prototype of TS_STATUS_INFO_get0_text - found
-- Looking for prototype of TS_VERIFY_CTS_set_certs(0,0)
-- Looking for prototype of TS_VERIFY_CTS_set_certs(0,0) - found
-- Looking for prototype of TS_VERIFY_CTX_set_data
-- Looking for prototype of TS_VERIFY_CTX_set_data - found
-- Looking for prototype of TS_VERIFY_CTX_set_flags
-- Looking for prototype of TS_VERIFY_CTX_set_flags - found
-- Looking for prototype of TS_VERIFY_CTX_set_store
-- Looking for prototype of TS_VERIFY_CTX_set_store - found
-- Looking for prototype of X509_get0_notAfter
-- Looking for prototype of X509_get0_notAfter - found
-- Looking for prototype of X509_get0_notBefore
-- Looking for prototype of X509_get0_notBefore - found
-- Looking for prototype of struct evp_md_ctx_st *a; EVP_MD_CTX *b=a
-- Looking for prototype of struct evp_md_ctx_st *a; EVP_MD_CTX *b=a - found
-- Looking for prototype of const ASN1_OBJECT *a; X509_ALGOR_get0(&a,0,0,0)
-- Looking for prototype of const ASN1_OBJECT *a; X509_ALGOR_get0(&a,0,0,0) - found
-- Looking for main in nsl
-- Looking for main in nsl - not found
-- Looking for gethostbyname in nsl
-- Looking for gethostbyname in nsl - found
-- Looking for main in socket
-- Looking for main in socket - not found
-- Looking for socket in socket
-- Looking for socket in socket - not found
-- Inspecting fundamental arithmetic types... 
--
--                    TRAPS MODULO
--   char              yes    yes
--   signed char       yes    yes
--   unsigned char     yes    yes
--   signed short      yes    yes
--   unsigned short    yes    yes
--   signed int        yes    yes
--   unsigned int      yes    yes
--   signed long       yes    yes
--   unsigned long     yes    yes
--
--                     float double
--   TRAPS               no     no
--   HAS INFINITY       yes    yes
--   QUIET NAN          yes    yes
--   SIGNALING NAN      yes    yes
--   IEC-559            yes    yes
--   HAS DENORM         yes    yes
--   TINYNESS BEFORE    yes    yes
--   DENORM LOSS        yes    yes
--
-- Looking for CMake command CONFIGURE_PACKAGE_CONFIG_FILE
-- Looking for CMake command CONFIGURE_PACKAGE_CONFIG_FILE - found
-- Looking for CMake command WRITE_BASIC_PACKAGE_VERSION_FILE
-- Looking for CMake command WRITE_BASIC_PACKAGE_VERSION_FILE - found
-- Configuring done
-- Generating done
-- Build files have been written to: /workspace/temp/dcmtk-3.6.7-build
I found out if I put pthread to the end of target_link_libraries

Code: Select all

target_link_libraries(demo dcmect dcmpmap dcmtract dcmseg dcmfg dcmiod dcmrt dcmpstat dcmqrdb dcmwlm dcmdsig cmr dcmsr dcmnet dcmtls dcmtkcharls dcmjpls ijg16 ijg12 ijg8 dcmjpeg dcmimage dcmimgle i2d dcmdata oflog ofstd z pthread)
I end up only with those undefined references:

Code: Select all

Scanning dependencies of target demo
[ 50%] Building CXX object CMakeFiles/demo.dir/demo.cc.o
[100%] Linking CXX executable demo
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::getLocaleEncoding()':
ofchrenc.cc:(.text+0x4a3): undefined reference to `ucnv_open_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x4e7): undefined reference to `ucnv_getName_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x4fa): undefined reference to `ucnv_close_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::~OFCharacterEncoding()':
ofchrenc.cc:(.text+0x5cb): undefined reference to `ucnv_close_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x5d4): undefined reference to `ucnv_close_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::operator=(OFCharacterEncoding const&)':
ofchrenc.cc:(.text+0x650): undefined reference to `ucnv_close_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x65a): undefined reference to `ucnv_close_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o):ofchrenc.cc:(.text+0x73b): more undefined references to `ucnv_close_66' follow
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::getConversionFlags() const':
ofchrenc.cc:(.text+0x7c8): undefined reference to `ucnv_getFromUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x7d4): undefined reference to `UCNV_FROM_U_CALLBACK_STOP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x7dd): undefined reference to `UCNV_FROM_U_CALLBACK_SKIP_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::setConversionFlags(unsigned int)':
ofchrenc.cc:(.text+0x858): undefined reference to `UCNV_FROM_U_CALLBACK_SKIP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x86c): undefined reference to `ucnv_setFromUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x8f7): undefined reference to `UCNV_FROM_U_CALLBACK_STOP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x90b): undefined reference to `ucnv_setFromUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x91e): undefined reference to `UCNV_TO_U_CALLBACK_STOP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x930): undefined reference to `ucnv_setToUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x963): undefined reference to `UCNV_TO_U_CALLBACK_SKIP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0x975): undefined reference to `ucnv_setToUCallBack_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::selectEncoding(OFString const&, OFString const&)':
ofchrenc.cc:(.text+0xa05): undefined reference to `ucnv_open_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xa17): undefined reference to `UCNV_TO_U_CALLBACK_STOP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xa29): undefined reference to `ucnv_setToUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xa52): undefined reference to `ucnv_open_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xa69): undefined reference to `ucnv_close_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xa72): undefined reference to `u_errorName_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xb31): undefined reference to `ucnv_close_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xb3a): undefined reference to `ucnv_close_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xbd3): undefined reference to `UCNV_FROM_U_CALLBACK_STOP_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xbe5): undefined reference to `ucnv_setFromUCallBack_66'
/usr/bin/ld: ofchrenc.cc:(.text+0xbf5): undefined reference to `ucnv_close_66'
/usr/bin/ld: /workspace/dcmtk-3.6.7-build/lib/libofstd.a(ofchrenc.cc.o): in function `OFCharacterEncoding::Implementation::convert(OFString&, char const*, unsigned long)':
ofchrenc.cc:(.text._ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm[_ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm]+0x115): undefined reference to `ucnv_convertEx_66'
/usr/bin/ld: ofchrenc.cc:(.text._ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm[_ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm]+0x18f): undefined reference to `ucnv_convertEx_66'
/usr/bin/ld: ofchrenc.cc:(.text._ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm[_ZN19OFCharacterEncoding14Implementation7convertER8OFStringPKcm]+0x1b4): undefined reference to `u_errorName_66'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/demo.dir/build.make:84: demo] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/demo.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
I will now try it without the find_package, use the install directory and report back. Thanks for your patience and looking into this.

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

Re: Minimal example (Linux) application using DCMTK with linking errors

#11 Post by Michael Onken »

You must also link against libicu which is used for character conversion.

If you don't need it, you can set DCMTK_ENABLE_CHARSET_CONVERSION to <disabled> (multiple choice field in cmake GUI).

Which version of DCMTK are you using? In latest DCMTK, you can also choose "oficonv" for the above parameter which then uses DCMTK's new builtin character conversion library.

zardoz
Posts: 9
Joined: Mon, 2023-03-06, 09:29

Re: Minimal example (Linux) application using DCMTK with linking errors

#12 Post by zardoz »

Thanks a lot! It finally compiles after adding icuuc to target_link_libraries :D

Here is my final CMakeLists.txt:

Code: Select all

project(demo)
cmake_minimum_required(VERSION 3.16)
include_directories(/workspace/dcmtk-3.6.7-install/usr/local/include)
link_directories(/workspace/dcmtk-3.6.7-install/usr/local/lib)
add_executable(demo demo.cc)
target_link_libraries(demo dcmect dcmpmap dcmtract dcmseg dcmfg dcmiod dcmrt dcmpstat dcmqrdb dcmwlm dcmdsig cmr dcmsr dcmnet dcmtls dcmtkcharls dcmjpls ijg16 ijg12 ijg8 dcmjpeg dcmimage dcmimgle i2d dcmdata oflog ofstd z icuuc pthread)
I'll look into the oficonv option, too. I am not bound to a particular version but used 3.6.7 for now.

One last question. I thought about linking libraries like libz statically with the DCMTK_PORTABLE_LINUX_BINARIES option as mentioned here. But after enabling it (and only this option) compilation of DCMTK fails (tried it with v3.6.7 but also with the master branch) with

Code: Select all

Scanning dependencies of target xml2dcm
[ 21%] Building CXX object dcmdata/apps/CMakeFiles/xml2dcm.dir/xml2dcm.cc.o
[ 21%] Linking CXX executable ../../bin/xml2dcm
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libicuuc.a(putil.ao): in function `uprv_dl_open_66':
(.text+0x1946): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libdl.a(dlopen.o): in function `dlopen':
(.text+0x9): undefined reference to `__dlopen'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libdl.a(dlclose.o): in function `dlclose':
(.text+0x5): undefined reference to `__dlclose'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libdl.a(dlsym.o): in function `dlsym':
(.text+0x9): undefined reference to `__dlsym'
collect2: error: ld returned 1 exit status
make[2]: *** [dcmdata/apps/CMakeFiles/xml2dcm.dir/build.make:99: bin/xml2dcm] Error 1
make[1]: *** [CMakeFiles/Makefile2:3281: dcmdata/apps/CMakeFiles/xml2dcm.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Any idea what's wrong here?

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

Re: Minimal example (Linux) application using DCMTK with linking errors

#13 Post by Michael Onken »

I think the DCMTK_PORTABLE_LINUX_BINARIES option is not very reliable but it just tries to build the binaries as portable as possible. Real static linkage is not possible with glibc (but you would need to link against to another libc like libmusl or dietlibc). My guess is that the libicu character set option / the underlying library does not permit the type of static linkage that DCMTK_PORTABLE_LINUX_BINARIES tries to enforce. But I am not sure.

Happy that it compiles after all :)

Best regards,
Michael

zardoz
Posts: 9
Joined: Mon, 2023-03-06, 09:29

Re: Minimal example (Linux) application using DCMTK with linking errors

#14 Post by zardoz »

Ah, I see. Then I stay with dynamic linking and DCMTK_PORTABLE_LINUX_BINARIES off. Thanks again for all the help and explanations!

Best regards,
Kai

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

Re: Minimal example (Linux) application using DCMTK with linking errors

#15 Post by Marco Eichelberg »

DCMTK_PORTABLE_LINUX_BINARIES tries to create portable Linux binaries by linking all libraries statically, with the exception of glibc, which is linked dynamically.
Glibc cannot be linked statically in a portable manner since the library will load additional shared objects at runtime, and this is likely to fail if you run a binary with static glibc linkage on a platform using a different glibc version.

Apparently, ICU has the same problem, it will try to load additional shared objects at runtime, so it won't work with DCMTK_PORTABLE_LINUX_BINARIES. Starting with DCMTK 3.6.8 (or the current git development tree) there will be a new DCMTK library named "oficonv" that is much smaller than ICU, embedded into DCMTK, and does not have that problem.

Post Reply

Who is online

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