Hello, I'm trying to use wininet with gcc. This simple example program compiles but does not link ("undefined reference", see below).
Thanks for all help.
The command line results:Code:// compile/link: // gcc -c test.c -o test.o // gcc -mwindows -lwininet test.o -o test.exe #include <windows.h> #include <wininet.h> HINTERNET bay; //----------------------------------------------------------------------------- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { bay=InternetOpen(0,INTERNET_OPEN_TYPE_DIRECT,0,0,0); }
Code:C:\gcc\Progs\>gcc -c test.c -o test.o C:\gcc\Progs\>gcc -mwindows -lwininet test.o -o test.exe test.o(.text+0x2e):test.c: undefined reference to `InternetOpenA@20' C:\gcc\Progs\>



LinkBack URL
About LinkBacks


