DragonFly users List (threaded) for 2007-01
DragonFly BSD
DragonFly users List (threaded) for 2007-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Help interpreting a linker error? (c++)


From: "Sepherosa Ziehau" <sepherosa@xxxxxxxxx>
Date: Thu, 18 Jan 2007 09:31:44 +0800

On 1/18/07, walt <wa1ter@myrealbox.com> wrote:
I just updated my -CURRENT machine, so lots of things have changed,
and I normally have trouble debugging linker errors anyway :o(

My problem is with pkgsrc/sysutils/fam:

Listener.o(.text+0x80): In function `Listener::Listener(bool, bool, unsigned
long, unsigned long)':
: undefined reference to `socket(int, int, int)'

When I do 'nm Listener.o' I see this line:
 U _Z6socketiii

Is that the symbol the linker is complaining about?  Does the 'iii' stand
for (int, int, int)?

AFAICT, socket() is defined in libc, right?  If socket() is defined in libc,
then why should the linker have trouble finding it?  (Well, libc does *not*
define _Z6socketiii, I'm almost certain.)

Also, can anyone running the latest HEAD reproduce this error?

Sorry, my fault. Please test the attached patch.


Best Regards,
sephe

--
Live Free or Die
--- socket.h.orig	2007-01-18 09:29:41.842066274 +0800
+++ socket.h	2007-01-18 09:29:32.097235497 +0800
@@ -474,7 +474,13 @@
 #endif /* !_KERNEL */
 
 #if !defined(_KERNEL) || defined(_KERNEL_VIRTUAL)
+#ifndef _SYS_CDEFS_H_
+#include <sys/cdefs.h>
+#endif
+
+__BEGIN_DECLS
 int	socket (int, int, int);
+__END_DECLS
 #endif	/* !_KERNEL || _KERNEL_VIRTUAL */
 
 #endif /* !_SYS_SOCKET_H_ */


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]