Compile error in dcmnet/libsrc/dwrap.c

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
chaircrusher
Posts: 32
Joined: Tue, 2011-12-20, 23:24
Location: iowa city,ia

Compile error in dcmnet/libsrc/dwrap.c

#1 Post by chaircrusher »

This is with today's master tag 148fc86171e0bee332a5fabd36d213f76e775a8b

I am compiling on a RHEL 6.3 machine. Running through leaves WITH_TCPWRAPPER undefined for some reason.

This cause a compile error in these lines of dcmnet/libsrc/dwrap.c

Code: Select all

0024 #ifndef TCPWRAPPER_SEVERITY_EXTERN
0025 int deny_severity = LOG_WARNING;
0026 int allow_severity = LOG_INFO;
0027 #endif
The problem is that WITH_TCPWRAPPER is undefined, so syslog.h isn't included and LOG_WARNING and LOG_INFO aren't defined.

The simplest fix is to include syslog.h unconditionally, since LOG_WARNING and LOG_INFO are referenced unconditionally:

Code: Select all

diff --git a/dcmnet/libsrc/dwrap.c b/dcmnet/libsrc/dwrap.c
index e93214e..8522efe 100644
--- a/dcmnet/libsrc/dwrap.c
+++ b/dcmnet/libsrc/dwrap.c
@@ -23,8 +23,8 @@
 
 #ifdef WITH_TCPWRAPPER
 #include <tcpd.h>               /* for hosts_ctl */
-#include <syslog.h>
 #endif
+#include <syslog.h>
 
 /* libwrap expects that two global flags, deny_severity and allow_severity,
  * are defined and initialized by user code. If these flags are already present


Uli Schlachter
DCMTK Developer
Posts: 120
Joined: Thu, 2009-11-26, 08:15

Re: Compile error in dcmnet/libsrc/dwrap.c

#2 Post by Uli Schlachter »

chaircrusher wrote:I am compiling on a RHEL 6.3 machine. Running through leaves WITH_TCPWRAPPER undefined for some reason.
You might want to check CMakeFiles/CMakeError.log and CMakeFiles/CMakeOutput.log. The libwrap-tests are looking for tcpd.h and a library called "wrap".
chaircrusher wrote:The problem is that WITH_TCPWRAPPER is undefined, so syslog.h isn't included and LOG_WARNING and LOG_INFO aren't defined.

The simplest fix is to include syslog.h unconditionally, since LOG_WARNING and LOG_INFO are referenced unconditionally:
Thanks for this bug report! However, including syslog.h unconditionally will likely break, because this file is also compiled on windows. No, I don't want to think about whether libwrap even works on windows. ;-)

I implemented a slightly different fix for this: http://git.dcmtk.org/web?p=dcmtk.git;a= ... cc05afffb8

Post Reply

Who is online

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