|
From: William S. <wil...@gm...> - 2010-11-25 17:32:59
|
The problem below I have no idea about. I tried my own ugly makefile (which I showed you before). It worked, but make seemed confused about what directory it was in! It claimed it couldn't find librand.a (to move) or rand.o (to delete). So I did those things by hand. Then I compiled my test program that used my rand library. Before that I told you that I edited the specs file as instructed. Worked! So the two mysteries are - those weird messages I got when doing a make of the library with the nice makefile - the fact that make got confused about what dir it was in when using my ugly makefile Thanks for any help! Bill On Thu, Nov 25, 2010 at 5:08 PM, William Simpson <wil...@gm...> 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 > > 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 > |