boost - g++ y aumenta el error del enlazador en Ubuntu oneiric
icc (1)
Recibo los siguientes errores después de una actualización. No puedo entender lo que está mal con eso. Debería funcionar tanto como yo pueda ver.
$ make 2>&1 | head
g++ -o prog -ansi -O2 -Wall -I/usr/include/boost -L/usr/lib -lboost_program_options -lboost_thread -lstdc++ ./YYY.o ./main.o ./myClass.o
./YYY.o: In function `void boost::call_once<void (*)()>(boost::once_flag&, void (*)())'':
YYY.cc:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x14): undefined reference to `boost::detail::get_once_per_thread_epoch()''
YYY.cc:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x2c): undefined reference to `boost::detail::once_epoch_mutex''
YYY.cc:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x62): undefined reference to `boost::detail::once_epoch_mutex''
YYY.cc:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x67): undefined reference to `boost::detail::once_epoch_cv''
YYY.cc:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0x95): undefined reference to `boost::detail::once_epoch_mutex''
YYY.cc:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0xa9): undefined reference to `boost::detail::once_epoch_mutex''
YYY.cc:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0xbd): undefined reference to `boost::detail::once_global_epoch''
YYY.cc:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[void boost::call_once<void (*)()>(boost::once_flag&, void (*)())]+0xc2): undefined reference to `boost::detail::once_epoch_cv''
$ ls -l /usr/lib/*boost_threa*
0 lrwxrwxrwx 1 root root 17 Jun 3 22:30 /usr/lib/libboost_thread-mt.a -> libboost_thread.a
0 lrwxrwxrwx 1 root root 25 Jun 3 22:30 /usr/lib/libboost_thread-mt.so -> libboost_thread.so.1.46.1
208K -rw-r--r-- 1 root root 208K Jun 3 22:30 /usr/lib/libboost_thread.a
0 lrwxrwxrwx 1 root root 25 Jun 3 22:30 /usr/lib/libboost_thread.so -> libboost_thread.so.1.46.1
88K -rw-r--r-- 1 root root 87K Oct 21 2010 /usr/lib/libboost_thread.so.1.42.0
100K -rw-r--r-- 1 root root 99K Jun 3 22:30 /usr/lib/libboost_thread.so.1.46.1
$ ls -ld /usr/include/boost/*thread*
4.0K drwxr-xr-x 5 root root 4.0K Oct 13 21:59 /usr/include/boost/thread/
4.0K -rw-r--r-- 1 root root 839 Jun 3 22:18 /usr/include/boost/thread.hpp
La solución implicaba cambiar el orden de vinculación, según la página del manual. El caso es que solía funcionar bien con una versión anterior de g ++ ...
$ make
g++ -I/usr/include/boost -MM ./YYY.cc ./main.cc ./myClass.cc > buildfiles.d
g++ -ansi -O2 -Wall -I/usr/include/boost -c -o main.o main.cc
g++ -ansi -O2 -Wall -I/usr/include/boost -c -o myClass.o myClass.cc
g++ -o prog -ansi -O2 -Wall -I/usr/include/boost ./YYY.o ./main.o ./myClass.o -lstdc++ -L/usr/lib -lboost_program_options -lboost_thread