Closed jwt27 closed 1 year ago
Hi,
Just ran into this strange error:
#include <stddef.h> #include <poll.h> int main() { return poll(NULL, 0, 0); }
Compiled as C++:
$ i386-pc-msdosdjgpp-g++ test.c -lwatt /usr/lib/gcc/i386-pc-msdosdjgpp/12.2.0/../../../../i386-pc-msdosdjgpp/bin/ld: /tmp/ccwlbj7Q.o:test.c:(.text+0x1b): undefined reference to `poll(pollfd*, int, int)' collect2: error: ld returned 1 exit status
But it links correctly when compiled as C.
Ah, poll() should be declared extern "C", of course. PR incoming...
poll()
extern "C"
Hi,
Just ran into this strange error:
Compiled as C++:
But it links correctly when compiled as C.