From: Mark S. <br...@rc...> - 2003-01-22 23:40:58
|
Oscar Fuentes wrote: >Mark Space <br...@rc...> writes: > > > >>I get "undefined reference to: "srandom"", but I'm using -l iberty on >>the command line. What am I missing here? nm that srandom should be >>in libiberty.a: >> >>"d:/MinGW/lib"-2.04$ nm -A *.a *.o | grep srandom >>libiberty.a:random.o:00000000 T _srandom >> >> > >[snip] > > > >>$(EXE) : $(OBJECTS) >> $(CC) -o $(EXE) $(CFLAGS) -l iberty $(OBJECTS) >> >> > >This is the Super-FAQ :-) Order of files on the link command >matters. This should fix the thing: > > $(CC) -o $(EXE) $(CFLAGS) $(OBJECTS) -l iberty > > > Thanks, that works. I was reading through the gcc docs on gnu.org, but these things don't always leap out at you. Thanks again. |