Building without libwrap on FreeBSD

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

Building without libwrap on FreeBSD

#1 Post by martinrame »

Hi, I'm trying to build a program that uses dcmnet on FreeBSD12.2

To build dcmtk 3.6.2 I used:

Code: Select all

CXX=clang++70 CC=clang70 cmake .
make
Everything built without issues, then I tried to compile my program, that requires dcmnet, dcmdata and a couple more libraries and got this:

Code: Select all

ld: error: undefined symbol: request_init                                                                                                                                     
>>> referenced by dul.cc                                                                                                                                                      
>>>               dul.cc.o:(receiveTransportConnectionTCP(PRIVATE_NETWORKKEY**, DUL_BLOCKOPTIONS, int, DUL_ASSOCIATESERVICEPARAMETERS*, PRIVATE_ASSOCIATIONKEY**)) in archive 
/home/informemedico/dcmtk/dcmtk-3.6.2/lib/libdcmnet.a
                                           
ld: error: undefined symbol: request_set                                                                                                                                      
>>> referenced by dul.cc                                                                                                                                                      
>>>               dul.cc.o:(receiveTransportConnectionTCP(PRIVATE_NETWORKKEY**, DUL_BLOCKOPTIONS, int, DUL_ASSOCIATESERVICEPARAMETERS*, PRIVATE_ASSOCIATIONKEY**)) in archive 
/home/informemedico/dcmtk/dcmtk-3.6.2/lib/libdcmnet.a
>>> referenced by dul.cc        
>>>               dul.cc.o:(receiveTransportConnectionTCP(PRIVATE_NETWORKKEY**, DUL_BLOCKOPTIONS, int, DUL_ASSOCIATESERVICEPARAMETERS*, PRIVATE_ASSOCIATIONKEY**)) in archive 
/home/informemedico/dcmtk/dcmtk-3.6.2/lib/libdcmnet.a                                                                                                                         
>>> referenced by dul.cc                
>>>               dul.cc.o:(receiveTransportConnectionTCP(PRIVATE_NETWORKKEY**, DUL_BLOCKOPTIONS, int, DUL_ASSOCIATESERVICEPARAMETERS*, PRIVATE_ASSOCIATIONKEY**)) in archive 
/home/informemedico/dcmtk/dcmtk-3.6.2/lib/libdcmnet.a
                                                                                                                                                                              
ld: error: undefined symbol: hosts_access                                                                                                                                     
>>> referenced by dwrap.c               
>>>               dwrap.c.o:(dcmtk_hosts_access) in archive /home/informemedico/dcmtk/dcmtk-3.6.2/lib/libdcmnet.a
                                           
ld: error: undefined symbol: locale_charset                                                                                                                                   
>>> referenced by ofchrenc.cc                                                          
>>>               ofchrenc.cc.o:(OFCharacterEncoding::getLocaleEncoding()) in archive /home/informemedico/dcmtk/dcmtk-3.6.2/lib/libofstd.a
>>> referenced by ofchrenc.cc
>>>               ofchrenc.cc.o:(OFCharacterEncoding::getLocaleEncoding()) in archive /home/informemedico/dcmtk/dcmtk-3.6.2/lib/libofstd.a
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
As far as I understand, those symbols are related to libwrap, which is no longer a library in FreeBSD, but it's included in the kernel (as far as I know). So, the question is: how can I build DCMTK without libwrap?, I'm using CMAKE.

Regards,
Leonardo.

martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

Re: Building without libwrap on FreeBSD

#2 Post by martinrame »

Now I'm building dcmtk with:

Code: Select all

CXX=clang++70 CC=clang70 cmake -DDCMTK_WITH_WRAP=OFF .
Let's see what happens.

martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

Re: Building without libwrap on FreeBSD

#3 Post by martinrame »

DCMTK build correctly, but now my programs returns this:

Code: Select all

ld: error: undefined symbol: locale_charset
>>> referenced by ofchrenc.cc
>>>               ofchrenc.cc.o:(OFCharacterEncoding::getLocaleEncoding()) in archive /home/informemedico/dcmtk/dcmtk-3.6.2/lib/libofstd.a
>>> referenced by ofchrenc.cc
>>>               ofchrenc.cc.o:(OFCharacterEncoding::getLocaleEncoding()) in archive /home/informemedico/dcmtk/dcmtk-3.6.2/lib/libofstd.a
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.

martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

Re: Building without libwrap on FreeBSD

#4 Post by martinrame »

Well, with this awful fix it compiled, now let's see if it works.

Code: Select all

344     static OFString getLocaleEncoding()
345     {
346 #ifdef WITH_LIBICONV
347         // basically, the function below should always return a non-empty string
348         // but older versions of libiconv might return NULL in certain cases
349         //return OFSTRING_GUARD(::locale_charset());
350         return OFString();
351 #else
352         return OFString();
353 #endif
354     }

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

Re: Building without libwrap on FreeBSD

#5 Post by Marco Eichelberg »

The symbol "locale_charset" is related to the iconv library and has nothing to do with libwrap. It seems that the detection routines have discovered some iconv functions, but apparently the library providing "locale_charset" is not linked. You can use the CMake variable "DCMTK_WITH_ICONV" to manually disable iconv, i.e. cmake -DDCMTK_WITH_ICONV=OFF.

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

Re: Building without libwrap on FreeBSD

#6 Post by Marco Eichelberg »

One more thing: DCMTK 3.6.2 is from 2017, I would strongly recommend you to upgrade to the current release, DCMTK 3.6.6.

Post Reply

Who is online

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