This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Mising some link
- From: Paulo Wilbert <pwilbert at uninet dot com dot br>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Sat, 02 Aug 2003 18:52:26 -0300
- Subject: Re: Mising some link
At 15:47 2/8/2003 -0500, Wayne wrote:
Waynes-a-dummy question:
Can you link a library that way in GCC? Have your
tried linking the library from your command line?
Wayne
I suppose so. For test that and to asseverate that all the #include's are
working I tried the following code that worked fine. I am using MinGW-2.0
package that contains GCC-3.2, binutils-1.3, gdb-5.1.1 and make-3.79.1,
mingw-runtime-2.2 and w32api-2.0.
---------------------------------------
#include <stdio.h>
#include <winsock2.h>
#include <windows.h>
#include <process.h>
#include <string.h>
#include <winbase.h>
#pragma comment(lib,"ws2_32")
void main(int argc,char ** argv)
{
printf ("Hello\n");
}
------------------------------------------
When I enter the full code with calls to the entry-points (WSAStartup,
Sockt, etc.) I got the errors.
Looking at some GCC documentation I understood that GCC does all the job
(preprocessing, compiling and linking). By use the command line to link the
library do you mean use the 'ld' command?
Rgds,
Paulo