From: StarG <St...@op...> - 2007-07-23 19:16:11
|
It was a plain build order problem. The problem gets solved by reordering the linker inputs. I wasn't aware that object code (here: main.o) adheres the very same rules when trying to link with libraries. Thanks goto Lithosphere who started to dig in the right hole and brought me on the right path. # compile statically $ /opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-g++ `/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/sdl-config --cflags` -I./src -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include ./tests/001/main.o -lSDL_Config -lSDL -lpthread -static -L. -o test1.gpu (note the main.o appearing before the -lSDL_Config) StarG StarG schrieb: > I tried to get those libs compiling and it seems it works for the first > one. When i'm trying to link this created library it fails with > "unresolved symbol" linker errors. > > (...) > > This works fine and creates the library. Now i try to build a supplied > test program. > > # compile statically > /opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-g++ > `/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/sdl-config --cflags` -I./src > -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -lSDL_Config -lSDL -static > -L. ./tests/001/main.o -o test1.gpu > > this dumps a lot of errors: > > ./tests/001/main.o: In function `main': > main.cpp:(.text+0x84): undefined reference to `CFG_OpenFile' > main.cpp:(.text+0x9c): undefined reference to `SDL_GetError' > main.cpp:(.text+0xd0): undefined reference to `SDL_GetError' > main.cpp:(.text+0x134): undefined reference to `CFG_ReadInt' > main.cpp:(.text+0x154): undefined reference to `CFG_SelectGroup' > [...] > > while the SDL_GetError seems somewhat external and not a real problem > here the CFG_* functions are in the library. At least it looks like they > do. I'm somewhat helpless in this matter as there is little information > in the error what went wrong. I'm looking for ideas how to solve such > errors for now and in the future - maybe using a clever way using nm. > > For a deeper look inside here is the my work archive for that library: > > http://nocool.dyndns.org/open2x/SDL_Config.tgz > > The supplied makefile should build the library with "make all" and > should try to make the testfiles with "make tests". > > Thanks in advance > StarG > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Open2x-devel mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/open2x-devel > |