Building with open SSL

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
JamesBloomScheff
Posts: 6
Joined: Mon, 2021-05-17, 09:28

Building with open SSL

#1 Post by JamesBloomScheff »

I'm in the process of migrating changes from a 64 bit project that uses DCMTK to to a 32 bit project.

I'm getting the the errors listed below. As far as I can tell, I'm building dcmtk with OPEN_SSL support (output below).

I'm using dcmtk 3.6.5 as that was the version used in the original 64 bit project. I grabbed open ssl1.1.1i from a dcmtk 3.6.6 installation that I had already downloaded.

I'm using visual studio 2017.

I have the following libraries included in the project (same settings as was in the 64 bit project): Iphlpapi.lib;comsuppw.lib;dcmdata.lib;ofstd.lib;dcmnet.lib;dcmtls.lib

I figure that I'm missing something stupid.

Anyone have any suggestions about what is going wrong?

Thanks

Code: Select all

Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18363.
Info: DCMTK OPENSSL support will be enabled
Info: DCMTK will compile with built-in (compiled-in) dictionary
Info: DCMTK will try to load external dictionary from default path on startup
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 enabled
Info: Wide char main function for command line tools will be disabled
Info: Building DCMTK without character set conversion support
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.
Info: Building DCMTK with large file support (LFS)
Info: C++11 features disabled
Info: C++14 features disabled
Info: C++17 features disabled
Info: STL vector support enabled
Info: STL algorithm support enabled
Info: STL limits support enabled
Info: STL list support enabled
Info: STL map support enabled
Info: STL memory support enabled
Info: STL stack support enabled
Info: STL string support enabled
Info: STL type_traits support enabled
Info: STL tuple support enabled
Info: STL system_error support enabled
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

Code: Select all

2>   Creating library C:\Users\SCHEFJX2\Desktop\DCMTK Conversion\sources\Application\Release\OCTDicomDLL.lib and object C:\Users\SCHEFJX2\Desktop\DCMTK Conversion\sources\Application\Release\OCTDicomDLL.exp
2>DTDicomNetwork.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall DcmTLSTransportLayer::DcmTLSTransportLayer(enum T_ASC_NetworkRole,char const *,bool)" (__imp_??0DcmTLSTransportLayer@@QAE@W4T_ASC_NetworkRole@@PBD_N@Z) referenced in function "protected: class OFCondition __thiscall CDTDicomNetwork::CreateTransportLayer(wchar_t const *)" (?CreateTransportLayer@CDTDicomNetwork@@IAE?AVOFCondition@@PB_W@Z)
2>DTDicomNetwork.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall DcmTLSTransportLayer::~DcmTLSTransportLayer(void)" (__imp_??1DcmTLSTransportLayer@@UAE@XZ) referenced in function "public: virtual void * __thiscall DcmTLSTransportLayer::`scalar deleting destructor'(unsigned int)" (??_GDcmTLSTransportLayer@@UAEPAXI@Z)
2>DTDicomNetwork.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: enum DcmTransportLayerStatus __thiscall DcmTLSTransportLayer::addTrustedCertificateFile(char const *,enum DcmKeyFileFormat)" (__imp_?addTrustedCertificateFile@DcmTLSTransportLayer@@QAE?AW4DcmTransportLayerStatus@@PBDW4DcmKeyFileFormat@@@Z) referenced in function "protected: class OFCondition __thiscall CDTDicomNetwork::AddTrustedCertificates(wchar_t const *)" (?AddTrustedCertificates@CDTDicomNetwork@@IAE?AVOFCondition@@PB_W@Z)
2>DTDicomNetwork.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: enum DcmTransportLayerStatus __thiscall DcmTLSTransportLayer::setTLSProfile(enum DcmTLSSecurityProfile)" (__imp_?setTLSProfile@DcmTLSTransportLayer@@QAE?AW4DcmTransportLayerStatus@@W4DcmTLSSecurityProfile@@@Z) referenced in function "protected: class OFCondition __thiscall CDTDicomNetwork::CreateTransportLayer(wchar_t const *)" (?CreateTransportLayer@CDTDicomNetwork@@IAE?AVOFCondition@@PB_W@Z)
2>DTDicomNetwork.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: enum DcmTransportLayerStatus __thiscall DcmTLSTransportLayer::activateCipherSuites(void)" (__imp_?activateCipherSuites@DcmTLSTransportLayer@@QAE?AW4DcmTransportLayerStatus@@XZ) referenced in function "protected: class OFCondition __thiscall CDTDicomNetwork::CreateTransportLayer(wchar_t const *)" (?CreateTransportLayer@CDTDicomNetwork@@IAE?AVOFCondition@@PB_W@Z)
2>DTDicomNetwork.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall DcmTLSTransportLayer::setCertificateVerification(enum DcmCertificateVerification)" (__imp_?setCertificateVerification@DcmTLSTransportLayer@@QAEXW4DcmCertificateVerification@@@Z) referenced in function "protected: class OFCondition __thiscall CDTDicomNetwork::CreateTransportLayer(wchar_t const *)" (?CreateTransportLayer@CDTDicomNetwork@@IAE?AVOFCondition@@PB_W@Z)
2>DTDicomNetwork.obj : error LNK2001: unresolved external symbol "public: virtual class DcmTransportConnection * __thiscall DcmTLSTransportLayer::createConnection(unsigned __int64,bool)" (?createConnection@DcmTLSTransportLayer@@UAEPAVDcmTransportConnection@@_K_N@Z)

JamesBloomScheff
Posts: 6
Joined: Mon, 2021-05-17, 09:28

Re: Building with open SSL

#2 Post by JamesBloomScheff »

Further information: As near as I can tell from depends.exe, those modules are not exported by dcmtls.dll.

In the cmake gui, I have the following option set
BUILD_SHARED_LIBS
DCMTK_COMPILE_WIN32_MULTITHREADED_DLL
DCMTK_ENABLE_BUILTIN_DICTIONARY
DCMTK_ENABLE_EXTERNAL_DICTIONARY = lfs
DCMTK_ENABLE_STL
DCMTK_MODULES = ofstd;oflog;dcmdata;dcmimgle;dcmimage;dcmjpeg;dcmjpls;dcmtls;dcmnet;dcmsr;dcmsign;dcmwlm;dcmqrdb;dcmpstat;dcmrt;dcmiod;dcmfg;dcmseg;dcmtract;dcmpmap
DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS
DCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS
DCMTK_WITH_OPENSSL
DCMTK_WITH_THREADS
WITH_OPENSSL = C:/openssl-1.1.1i

JamesBloomScheff
Posts: 6
Joined: Mon, 2021-05-17, 09:28

Re: Building with open SSL

#3 Post by JamesBloomScheff »

I do see thousands of messages like this:

Code: Select all

  File:

    C:/Users/SCHEFJX2/Desktop/DCMTK Conversion/3.6.5/dcmtk-3.6.5/dcmtls/libsrc/tlslayer.cc
Call Stack (most recent call first):
  dcmtls/libsrc/CMakeLists.txt:2 (DCMTK_ADD_LIBRARY)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMake/dcmtkMacros.cmake:82 (add_library):
  Policy CMP0115 is not set: Source file extensions must be explicit.  Run
  "cmake --help-policy CMP0115" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

JamesBloomScheff
Posts: 6
Joined: Mon, 2021-05-17, 09:28

Re: Building with open SSL

#4 Post by JamesBloomScheff »

The project file for dcmtls does not have WITH_OPENSSL defined. Depends shows that tlslayer_dummy_function is exported.

JamesBloomScheff
Posts: 6
Joined: Mon, 2021-05-17, 09:28

Re: Building with open SSL

#5 Post by JamesBloomScheff »

Things are working a bit better. As far as I know, the only thing I changed was the case of the drive letter in the WITH_OPENSSL from a capital C to a lowercase C. I'm still getting this link error

DTDicomNetwork.obj : error LNK2001: unresolved external symbol "public: virtual class DcmTransportConnection * __thiscall DcmTLSTransportLayer::createConnection(unsigned __int64,bool)" (?createConnection@DcmTLSTransportLayer@@UAEPAVDcmTransportConnection@@_K_N@Z)
2>

but thats the only one.

JamesBloomScheff
Posts: 6
Joined: Mon, 2021-05-17, 09:28

Re: Building with open SSL

#6 Post by JamesBloomScheff »

this last one was my fault. I still had a couple of include files from the 64 bit project that were being pulled into the 32 bit project.

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

Re: Building with open SSL

#7 Post by Marco Eichelberg »

Thanks for posting your progress in solving this issue.
Things are working a bit better. As far as I know, the only thing I changed was the case of the drive letter in the WITH_OPENSSL from a capital C to a lowercase C.
That is weird, but most likely a CMake issue.

jogerh
Posts: 37
Joined: Mon, 2022-02-28, 08:55

Re: Building with open SSL

#8 Post by jogerh »

This kind of problem can show up if the dcmtkcrypto_d.lib, dcmtkcrypto_o.lib, dcmtkssl_d.lib, or dcmtkssl_o.lib are not present in the expected directory when configuring the project. I assume the heuristics for determining if OpenSsl can be found does not check presence of all libs. So, after determining that OpenSSL is present, it attempts to probe OpenSsl for capabilities by compiling small snippets exercising each capability. If the lib is not present, these tests may fail, and determine that HAVE_OPENSSL should not be defined.

One way to check if these capability tests fail is to inspect CMakeFiles\CMakeError.log, and search for ssl.h. Then you will see if there are any errors reported during the capability checks.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest