From: StarG <St...@op...> - 2007-07-22 23:27:19
|
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. Library creation process: # compile /opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-g++ -DGP2X `/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 -c -o src/SDL_config.o src/SDL_config.c # archive /opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-ar rc libSDL_Config.a ./src/SDL_config.o # use ranlib /opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-ranlib libSDL_Config.a 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 |