I noticed now that using ldd does not list libmylib as a dependency of the executable. I think it should, shouldn't it? 2009/4/11 Germán Diago <germandiago@xxxxxxxxx>: > Hello. I'm having problems with what it seemed to work before. I'm > under ubuntu 9.04, gcc .4.3.3 compiler. > > I have a project in which I build a shared library. > The shared library is later used in an executable. > > When I try to run the executable, once compiled, I get a strange error: > > It does not find some symbols from my shared library. I checked the > library with the program nm. > There are no undefined (relevant) symbols for my shared library there. > > However, in my executable, the following is shown with nm -u (I just > copy here what it's relevant): > > U _ZN3ftr10Aplicacion11dibujarTodoER9SDL_Event > U _ZN3ftr10Aplicacion11inicializarEv > U _ZN3ftr10Aplicacion12addDibujableERKN5boost8functionIFvR9SDL_EventESaIvEEENS_15PrioridadDibujoE > U _ZN3ftr10Aplicacion17refrescarPantallaEv > U _ZN3ftr10Aplicacion8addTareaEPFvR9SDL_EventE > U _ZN3ftr10Aplicacion8ejecutarEv > U _ZN3ftr10AplicacionD1Ev > U _ZN3ftr12MonitorDatos7dibujarER9SDL_Event > U _ZN3ftr12MonitorDatosC1Ev > U _ZN3ftr12MonitorDatosD1Ev > U _ZN3ftr18ParseadorEscenario7parsearERKSs > U _ZN3ftr18ParseadorEscenarioC1ERNS_9EscenarioE > U _ZN3ftr18ParseadorEscenarioD1Ev > U _ZN3ftr18ParseadorPersonaje7parsearERKSs > U _ZN3ftr18ParseadorPersonajeC1ERNS_9PersonajeE > U _ZN3ftr18ParseadorPersonajeD1Ev > U _ZN3ftr9Escenario11inicializarEv > U _ZN3ftr9Escenario7dibujarER9SDL_Event > U _ZN3ftr9EscenarioC1Ev > U _ZN3ftr9EscenarioD1Ev > U _ZNK3ftr9Personaje7getPosXEv > U _ZNK3ftr9Personaje7getPosYEv > > > These symbols are from the library I compiled, and they appear as > undefined in the executable, so when I try to execute > my program, it fails. > > If I compile a Static library everything is ok, but I need to compile > a shared library for other purposes. > > > This compilation command is used to build files in my shared library: > > g++ -o build/linux2/release/libmylib/Utility.os -c -O3 -fPIC > -D_GNU_SOURCE=1 -D_REENTRANT -DDATA_DIR=\"/usr/share/mylib/\" > -DTIXML_USE_STL=YES -I/usr/include/python2.6 -I/usr/include/SDL > -Ibuild/linux2/release/libmylib -Ilibmylib -Itinyxml > libfollowtherabbit/Utility.cpp > > This is the link gcc command: > > g++ -o build/linux2/release/libmylib/libmylib.so -shared (all object > files here and other libraries here) > > This is used for my executable: > > g++ -o build/linux2/release/src/myprogram > build/linux2/release/src/myprogram.o -Lbuild/linux2/release/libmylib > -Llibmylib -L/usr/lib -lmylib > build/linux2/release/tinyxml/libtinyxml.a -lSDL_ttf -lSDL_mixer -lSDL > > Thanks for your help >