Skip to contentSkip to conversation

Compile Problem !

DISCUSSION Zoup 2 participants 2 messages Jul 18, 2003

lore
Share & tools
lore

Zoup

author
#0 lore raw

Got this error on make ! :(

iald.c
diald.c: In function `main':
diald.c:192: `CLK_TCK' undeclared (first use in this function) diald.c:192: (Each undeclared identifier is reported only once diald.c:192: for each function it appears in.)
make: *** [diald.o] Error 1

im running Slackware9 !
what is the problem ? :)

thanks

Signature · 1 line
Wish You Were Here ...
#1 lore raw
Quoted 9 lines · Zoup

Got this error on make ! :(

iald.c
diald.c: In function `main':
diald.c:192: `CLK_TCK' undeclared (first use in this function) diald.c:192: (Each undeclared identifier is reported only once diald.c:192: for each function it appears in.)
make: *** [diald.o] Error 1

Quoted 5 lines

im running Slackware9 ! what is the problem ? :)

thanks

I had this problem way back, I dredged this out of the archive - hope it still works. If it doesn't, try mucking around with #include <sys/time.h> and #include <time.h> some order and combination will probably work.

cheers

Loz

Here are a couple of patches for diald-1.0.

If autoconf defines both
HAVE_SYS_TIME_H and TIME_WITH_SYS_TIME
then *both* sys/time.h and time.h should be included, but diald-1.0 fails to also include time.h, which defines CLK_TCK. (older diald did include both)

Fixing this on a RedHat 7.x system (where both get defined) fixes the undefined CLK_TCK problem in diald.c, without messing with diald.c

So this may be the "correct" fix to the problem, rather than changing #if CLK_TCK to #ifdef CLK_TCK in diald.c

the fix is now in diald.h:
--------------------------------------------------

diald.h Fri Sep 7 02:57:56 2001 renamed from diald.h Sat Jun 16 12:01:25 2001 +5 -0
diff -uNr diald-1.0/diald.h diald-1.0-patched/diald.h
@@ -29,6 +29,11 @@
 #include <signal.h>
 #if HAVE_SYS_TIME_H
 #  include <sys/time.h>
+#if TIME_WITH_SYS_TIME
+#  include <time.h>
+#endif
+#else
+#  include <time.h>
 #endif
 #ifdef _POSIX_PRIORITY_SCHEDULING
 #  include <sched.h>

----------------------------------------------------

(2) A compiler warning in timer.c is generated because the arguments of the functions del_impulse() and del_connection()
in firewall.c should be passed as void * , and then be cast to FW_unit * and FW_connection *, respectively.

This is fixed by the second attached patch

----------------------------------
E-Mail: [email protected]
Date: 12-Jan-2002
Time: 14:35:12

This message was sent by XFMail
----------------------------------

diald.h +2 -2
diff -uNr diald-1.0/diald.h diald-1.0-void/diald.h
@@ -488,6 +488,6 @@
 int getprotocol(const char *name);
 char *getprotonumber(int proto);
 int getsn(FILE *fp,char *buf,int len);
-void del_impulse(FW_unit *unit);
-void del_connection(FW_Connection *c);
+void del_impulse(void *unit);
+void del_connection(void *c);
 void slip_start_fail(void * data);
firewall.c +6 -7
diff -uNr diald-1.0/firewall.c diald-1.0-void/firewall.c
@@ -24,8 +24,6 @@
 int impulse_time = 0;
 int impulse_fuzz = 0;
 
-void del_connection(FW_Connection *);
-
 /*
  * Initialize the units.
  */
@@ -69,7 +67,7 @@
 #if 0
     mon_syslog(LOG_DEBUG,"slot def: %d %d %x %x %x",
 	slot->start, slot->end, slot->wday, slot->mday, slot->month);
-#endif 0
+#endif 
 	if ((slot->start <= ctime)
 	&&  (ctime <= slot->end)
 	&&  (slot->wday & (1<<ltime->tm_wday))
@@ -370,7 +368,7 @@
 	} else {
 	    /* timeout = 0, so toss the connection */
 	    del_timer(&c->timer);
-	    del_connection(c);
+	    del_connection((void *)c);
 	}
     }
 }
@@ -379,8 +377,9 @@
  * Get a connection out of a queue.
  */
 
-void del_connection(FW_Connection *c)
+void del_connection(void *c_void )
 {
+    FW_Connection *c = (FW_Connection *) c_void;
     if (debug&DEBUG_CONNECTION_QUEUE)
 	mon_syslog(LOG_DEBUG,"Deleting connection %p @ %ld",c,time(0));
 
@@ -390,9 +389,9 @@
     free(c);
 }
 
-void del_impulse(FW_unit *unit)
+void del_impulse(void  *unit_void)
 {
-
+    FW_unit *unit = (FW_unit *) unit_void;
     if (unit->impulse_mode) {
 	unit->impulse_mode = 0;
 	if (impulse_time > 0) {
diald.h +5 -0
diff -uNr diald-1.0/diald.h diald-1.0-patched/diald.h
@@ -29,6 +29,11 @@
 #include <signal.h>
 #if HAVE_SYS_TIME_H
 #  include <sys/time.h>
+#if TIME_WITH_SYS_TIME
+#  include <time.h>
+#endif
+#else
+#  include <time.h>
 #endif
 #ifdef _POSIX_PRIORITY_SCHEDULING
 #  include <sched.h>