Joe Orton wrote:
It looks like the fix used for the first problem is the cause of the
second problem.  If the #include is avoided then the compiler won't know
or care about the function prototype, and this check will just test
whether the link works, which is as intended.

Why was the #include needed?  Because winsock2.h #defines socket to
something else?  The correct fix for that should just be to check for
that symbol first and then avoid the check for symbol later.
  
I tried this on my Linux machine, and I can see what you mean. But with MinGW, I can't seem to get this to compile without using a header (and thus parameters). This code...
int main()
{
   socket();
   return 0;
}
...will fail with "gcc tmp.c -lwsock32" or "gcc tmp.c -lws2_32" ("undefined reference to 'socket'"). However, it compiles as soon as I add the header and parameters. One oddity regarding MinGW/msys is that the windows libraries are installed to /mingw/lib, but I'm not sure that has any effect on the problem here.

I'm using GNU ld version 2.16.91 20060119.

Any ideas of things to try?

-Matthias Miller
_______________________________________________
neon mailing list
[email protected]
http://mailman.webdav.org/mailman/listinfo/neon

Reply via email to