[CMake] FindBoost bug on debian or something's missing? - errata

Mike Jackson imikejackson at gmail.com
Thu Dec 13 13:27:20 EST 2007


Did you build the "Data_Time" boost library? Are you linking against  
the libboost_date_time.... library? Run a 'make VERBOSE=1' and post  
the ouput.


-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Dec 13, 2007, at 1:19 PM, Tomasz Kalkosiński wrote:

> Sorry, I forgot to add make output:
>
>> make
> Scanning dependencies of target time
> [100%] Building CXX object CMakeFiles/time.dir/time.o
> Linking CXX executable time
> CMakeFiles/time.dir/time.o: In function  
> `boost::date_time::month_formatter<boost::gregorian::greg_month,  
> boost::date_time::simple_format<char>, char>::format_month 
> (boost::gregorian::greg_month const&, std::basic_ostream<char,  
> std::char_traits<char> >&)':
> time.cpp: 
> (.text._ZN5boost9date_time15month_formatterINS_9gregorian10greg_monthE 
> NS0_13simple_formatIcEEcE12format_monthERKS3_RSo 
> [boost::date_time::month_formatter<boost::gregorian::greg_month,  
> boost::date_time::simple_format<char>, char>::format_month 
> (boost::gregorian::greg_month const&, std::basic_ostream<char,  
> std::char_traits<char> >&)]+0x2d): undefined reference to  
> `boost::gregorian::greg_month::as_short_string() const'
> time.cpp: 
> (.text._ZN5boost9date_time15month_formatterINS_9gregorian10greg_monthE 
> NS0_13simple_formatIcEEcE12format_monthERKS3_RSo 
> [boost::date_time::month_formatter<boost::gregorian::greg_month,  
> boost::date_time::simple_format<char>, char>::format_month 
> (boost::gregorian::greg_month const&, std::basic_ostream<char,  
> std::char_traits<char> >&)]+0x4c): undefined reference to  
> `boost::gregorian::greg_month::as_long_string() const'
> collect2: ld returned 1 exit status
> make[2]: *** [time] Error 1
> make[1]: *** [CMakeFiles/time.dir/all] Error 2
> make: *** [all] Error 2
>
> Source for time.cpp:
>
> $ cat time.cpp
>
> #include "boost/date_time/posix_time/posix_time.hpp"
> #include <iostream>
>
>    int
>    main()
>    {
>      using namespace boost::posix_time;
>      using namespace boost::gregorian;
>
>      ptime now = microsec_clock::local_time();
>      time_iterator titr(now, milliseconds(800));
>
> 	for (int i = 0 ; i < 10 ; ++titr, ++i)
> 	{
> 		ptime later = now + milliseconds (800);
> 	      std::cout << to_simple_string(*titr) << std::endl;
> 	      std::cout << to_simple_string(now) << std::endl;
> 	      std::cout << to_simple_string(later) << std::endl;
>
> 		  do {
> 			  now = microsec_clock::local_time();
> 			  } while (now < later);
> 	}
>
>      return 0;
>    }
>
> Greetings,
> Tomasz Kalkosiński
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list