|
From: John B. <joh...@ho...> - 2010-11-25 23:52:28
|
On Thu, 25 Nov 2010 17:08:33 +0000, William Simpson wrote: > > OK using the suggested makefile on my rand library, I get: > > C:\MinGW\local\lib\src\rand>make > gcc rand.o librand.a -o rand > c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../libmingw32.a(main.o):main.c:(.tex > t+0xd2): undefined reference to `WinMain@16' > collect2: ld returned 1 exit status > mingw32-make: *** [rand] Error 1 > This command is trying to link rand.o with librand.a to make an executablecalled rand(.exe on Windows). This can't possibly be what you meant to do. Since every program must have a main() (or WinMain() for GUI programs),and rand.o does not, the linker complains. You really should just Google for a tutorial that explains how to compileprograms with gcc. The gcc manual (available at www.gnu.org) probablywon't help you with that. Regards, Alias John Brown. |