#311 epuck driver blocks static linking

trunk
closed-fixed
Brian Gerkey
player (137)
5
2014-02-16
2009-11-06
Paul Osmialowski
No

I had to link player binary statically (option SHARED_LIBS set to OFF in ccmake), everything went fine except that I had to turn off Epuck driver. If it is turned on, the error message is:
Scanning dependencies of target player
[ 88%] Building CXX object server/CMakeFiles/player.dir/server.o
Linking CXX executable player
/home/newchief/psg3/src/build/server/libplayerdrivers/libplayerdrivers.a(Timer.o): In function `Timer::Timer()':Timer.cpp:(.text+0x1c4): multiple definition of `Timer::Timer()'
/home/newchief/psg3/src/build/server/libplayerdrivers/libplayerdrivers.a(epuckPosition2d.o):epuckPosition2d.cpp:(.text._ZN5TimerC1Ev[Timer::Timer()]+0x0): first defined here
/scratchbox/compilers/cs2005q3.2-glibc2.5-arm/bin/../lib/gcc/arm-none-linux-gnueabi/3.4.4/../../../../arm-none-linux-gnueabi/bin/ld: Warning: size of symbol `Timer::Timer()' changed
from 48 in /home/newchief/psg3/src/build/server/libplayerdrivers/libplayerdrivers.a(epuckPosition2d.o) to 68 in /home/newchief/psg3/src/build/server/libplayerdrivers/libplayerdrivers
.a(Timer.o)
collect2: ld returned 1 exit status
make[2]: *** [server/player] Error 1
make[1]: *** [server/CMakeFiles/player.dir/all] Error 2
make: *** [all] Error 2

Discussion

  • Rich Mattes
    Rich Mattes
    2014-02-16

    • status: open --> closed-fixed
     
  • Rich Mattes
    Rich Mattes
    2014-02-16

    Both instances of Timer were renamed (to EpuckTimer and MricpTimer) so they will not conflict.