|
From: William S. <wil...@gm...> - 2010-11-25 17:08:39
|
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 So far as I know, I configured everything correctly when I installed mingw. I compiled hello.c ok. At first I thought it was because I created and modified specs in the way shown in the HOWTO. But I renamed the specs file and the problem remained. Thanks for any help! Bill ============== makefile below rand: librand.a CC = gcc libdir = c:/mingw/local/lib includedir = c:/mingw/local/include %.o: %.c $(CC) -c $< rand.o: rand.c rand.h librand.a: rand.o # and any other objects you wish it to include del $@ ar rcvs $@ $^ install: copy librand.a $(libdir) copy rand.h $(includedir) clean: del *.o distclean: clean del *.a |