|
From: Jose F. <j_r...@ya...> - 2001-11-29 18:18:00
|
Hi, The order of the libraries is important. Since the gnu ld generaly onle makes one pass it must know in advance which symbols are needed from each library. That means that all libraries must come after the objects files. This is also why is very common on Makefile to put the libraries in a separate variable and not on LDFLAGS, e.g.: LD=$(CXX) $(CXXFLAGS) LDFLAGS=-mwindows -mno-cygwin -Wl,--verbose LIBS=-lversion target: $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) Regards, Jose Fonseca On Thu, 2001-11-29 at 17:11, Polley Christopher W wrote: > Hi, all: > > I'm having a curious problem linking with version.dll: > > linking (LDFLAGS=-Wall -mwindows -lversion -mno-cygwin -Wl,--verbose) fails > with: > >winmain.o(.text+0xd0):winmain.c: undefined reference to > `GetFileVersionInfoSizeA@8' > >winmain.o(.text+0x11b):winmain.c: undefined reference to > `GetFileVersionInfoA@16' > >winmain.o(.text+0x16f):winmain.c: undefined reference to > `VerQueryValueA@16' > >winmain.o(.text+0x226):winmain.c: undefined reference to > `VerQueryValueA@16' > >winmain.o(.text+0x278):winmain.c: undefined reference to > `VerQueryValueA@16' > >winmain.o(.text+0x2d6):winmain.c: undefined reference to > `VerQueryValueA@16' > >winmain.o(.text+0xf8b):winmain.c: undefined reference to > `GetFileVersionInfoSizeA@8' > >winmain.o(.text+0xfe2):winmain.c: undefined reference to > `GetFileVersionInfoA@16' > >winmain.o(.text+0x1040):winmain.c: undefined reference to > `VerQueryValueA@16' > >winmain.o(.text+0x10d5):winmain.c: undefined reference to > `VerQueryValueA@16' > > but win32api/libversion.a is found > >attempt to open /usr/lib/w32api/libversion.a succeeded > > and contains the symbols in question: > (trimmed output of nm -g /usr/lib/w32api/libversion.a) > >ds00010.o: > >00000000 T _VerQueryValueA@16 > >ds00001.o: > >00000000 T _GetFileVersionInfoSizeA@8 > >ds00000.o: > >00000000 T _GetFileVersionInfoA@16 > > (trimmed output of nm -u winmain.o) > >_GetFileVersionInfoA@16 > >_GetFileVersionInfoSizeA@8 > >_VerQueryValueA@16 > > I'm using a very recent install of cygwin, with the exception that I'm using > cygwin-1.3.2-1 and bash-2.05-8 (due to the null handle dup problem mentioned > in my posts to the cygwin ml last week) > > If I remove the sections of code in winmain.c that refer to these functions, > the code compiles and runs (but doesn't pull the version info out of the > resources, of course) > > Any ideas why this won't link? > > Warm Regards, > Chris > > > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options at: > https://lists.sourceforge.net/lists/listinfo/mingw-users |