GG Compiling: Missing Symbols

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
raptor_85
Space Krill
Posts: 4
Joined: Sun Jan 25, 2009 10:33 pm

GG Compiling: Missing Symbols

#1 Post by raptor_85 »

I am using OS X 10.5 and trying to compile GiGiSDL. The GiGi lib compiles without errors, but when compiling the GiGiSDL lib I get:

Code: Select all

g++ -o libGiGiSDL.dylib -Wl,-framework,Cocoa -dynamiclib src/SDL/SDLGUI.os -L/Developer/src/freeorion/FreeOrion/osx/dep/local/lib -L/usr/local/lib -lboost_signals-xgcc40-mt-1_37 -lboost_system-xgcc40-mt-1_37 -lboost_filesystem-xgcc40-mt-1_37 -lboost_thread-xgcc40-mt-1_37 -lGL -lGLU -lz -lfreetype -ljpeg -lpng -ltiff -lSDLmain -lSDL
Undefined symbols:
  "GG::Y1", referenced from:
      __ZN2GG2Y1E$non_lazy_ptr in SDLGUI.os
  "GG::GUI::Wait(unsigned int)", referenced from:
      vtable for GG::SDLGUIin SDLGUI.os
  "GG::FlagSpec<GG::ModKey>::instance()", referenced from:
      (anonymous namespace)::GetSDLModKeys()                                 in SDLGUI.os
      (anonymous namespace)::GetSDLModKeys()                                 in SDLGUI.os
      (anonymous namespace)::GetSDLModKeys()                                 in SDLGUI.os
      (anonymous namespace)::GetSDLModKeys()                                 in SDLGUI.os
      (anonymous namespace)::GetSDLModKeys()                                 in SDLGUI.os
      (anonymous namespace)::GetSDLModKeys()                                 in SDLGUI.os
      (anonymous namespace)::GetSDLModKeys()                                 in SDLGUI.os
      GG::Flags<GG::ModKey>::Flags(GG::ModKey)in SDLGUI.os
  "GG::GUI::Render()", referenced from:
      vtable for GG::SDLGUIin SDLGUI.os
  "GG::MOD_KEY_LCTRL", referenced from:
      __ZN2GG13MOD_KEY_LCTRLE$non_lazy_ptr in SDLGUI.os
  "GG::GUI::CreateModalEventPump(bool&)", referenced from:
      vtable for GG::SDLGUIin SDLGUI.os
  "GG::MOD_KEY_RALT", referenced from:
      __ZN2GG12MOD_KEY_RALTE$non_lazy_ptr in SDLGUI.os
  "GG::EventPump::operator()()", referenced from:
      GG::SDLGUI::Run()    in SDLGUI.os
  "GG::GUI::EnableMouseButtonDownRepeat(unsigned int, unsigned int)", referenced from:
      GG::SDLGUI::SDLInit()    in SDLGUI.os
Truncated, with the ending:

Code: Select all

  "vtable for GG::EventPump", referenced from:
      __ZTVN2GG9EventPumpE$non_lazy_ptr in SDLGUI.os
  "GG::MOD_KEY_MODE", referenced from:
      __ZN2GG12MOD_KEY_MODEE$non_lazy_ptr in SDLGUI.os
  "GG::X0", referenced from:
      __ZN2GG2X0E$non_lazy_ptr in SDLGUI.os
ld: symbol(s) not found
collect2: ld returned 1 exit status
scons: *** [libGiGiSDL.dylib] Error 1
scons: building terminated because of errors.

I built SDL from source so presumably I did something wrong there. I picked this out of the SDL compile:

Code: Select all

ranlib: file: build/.libs/libSDL.a(SDL_audiodev.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_mixer_MMX_VC.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_mixer_m68k.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_getenv.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_malloc.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_qsort.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_stdlib.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_nullmouse.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_dgamouse.o) has no symbols
ranlib build/.libs/libSDL.a
ranlib: file: build/.libs/libSDL.a(SDL_audiodev.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_mixer_MMX_VC.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_mixer_m68k.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_getenv.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_malloc.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_qsort.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_stdlib.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_nullmouse.o) has no symbols
ranlib: file: build/.libs/libSDL.a(SDL_dgamouse.o) has no symbols
creating build/libSDL.la
Otherwise SDL seemed to build OK. Is this my problem? If so, I have no idea how to fix this. Any ideas?

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: GG Compiling: Missing Symbols

#2 Post by kroddn »

The missing symbols are GiGi symbols.

One thing I recognize: it seems that libGiGi is not named on the command line. Maybe appending "-L. -lGiGi" would do the trick?

try:

Code: Select all

g++ -o libGiGiSDL.dylib -Wl,-framework,Cocoa -dynamiclib src/SDL/SDLGUI.os -L/Developer/src/freeorion/FreeOrion/osx/dep/local/lib -L/usr/local/lib -lboost_signals-xgcc40-mt-1_37 -lboost_system-xgcc40-mt-1_37 -lboost_filesystem-xgcc40-mt-1_37 -lboost_thread-xgcc40-mt-1_37 -lGL -lGLU -lz -lfreetype -ljpeg -lpng -ltiff -lSDLmain -lSDL -L. -lGiGi

raptor_85
Space Krill
Posts: 4
Joined: Sun Jan 25, 2009 10:33 pm

Re: GG Compiling: Missing Symbols

#3 Post by raptor_85 »

Thanks, that seems to have done it. I only had to use -lGiGi (the -L. gave errors). The file builds, but I had to install it manually.

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: GG Compiling: Missing Symbols

#4 Post by kroddn »

Did you use scons before? I think someone who knows a bit about macs should be able to fix the problem.

raptor_85
Space Krill
Posts: 4
Joined: Sun Jan 25, 2009 10:33 pm

Re: GG Compiling: Missing Symbols

#5 Post by raptor_85 »

Yes, I used scons to build the GiGi libraries up to the one error. That last command to build the GiGiSDL lib was all that failed. I was hoping that the other build commands completed before the creation of the dylib. Do you think it produced a false GiGiSDL lib?

Now I'm having problems with the FreeOrion compile. The initial check for Python in the scons file isn't working correctly. Probably another mac issue, but maybe you can help. There was one other forum thread about it, but nothing was resolved.

scons in the FreeOrion directory returns:

Code: Select all

File "/Developer/src/freeorion/FreeOrion/SConstruct", line 21, in <module>
Configuring unknown system (assuming the system is POSIX-like) ...
Unable to determine the name of the Python runtime library.  Terminating....
From what I've read so far, the mac users here are rather sparse. But either way, thanks for your help.

Post Reply