DragonFly BSD
DragonFly bugs List (threaded) for 2006-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Undefined reference to 'select()'


From: David Cuthbert <dacut@xxxxxxxxx>
Date: Sun, 18 Jun 2006 00:56:18 -0700

walt wrote:
Just for fun I added this prototype to the code:
extern "C" int select(int, fd_set*, fd_set*, fd_set*, struct timeval*);
Now I get complaints from <sys/select.h> about duplicate definitions
of select()  :o(

This indicates that sys/select.h should be wrapped in the extern "C". Sounds like this got removed from a recent commit.


In general, all headers for C functions should look like:


#ifndef MY_HEADER #define MY_HEADER #include <blah.h> #include ...

#ifdef __cplusplus
extern "C" {
#endif

void my_function();

#ifdef __cplusplus
}
#endif

#endif /* MY_HEADER */



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