
On Sat, 16 Apr 2005 10:11:58 +0100, Gander wrote
Hi,
I get an error linking the example program days_alive to the shared library libboost_date_time.
g++ -L/usr/lib -lboost_date_time -odays_alive days_alive.o
days_alive.o(.gnu.linkonce.t._ZN5boost9date_time19month_str_to_ushortINS_9gregorian10greg_monthEEEtSs+0xec): In function `unsigned short boost::date_time::month_str_to_ushort<boost::gregorian::greg_month>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)': /usr/include/boost/token_functions.hpp:587: undefined reference to `boost::gregorian::greg_month::get_month_map_ptr()' collect2: ld returned 1 exit status
Platform is FC2 gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
I built Boost from the SRC RPM boost-1.32.0-3.src.rpm with no special switches.
I found a comment in the boost mailings advising linking to static library. This was successful.
Is the general advice to only use the static libraries?
The shared library works fine for me on Mandrake -- but I built it and installed it myself. Are you 100% sure the library path and name are correct? If you build boost directly the library names are different: boost_date_time-gcc-d-1-32.so for example... Jeff