1

I am using b2.exe to compile Boost.DateTime:

.\b2.exe install --with-date_time link=static runtime-link=static 

It create bin.v2 directory in C\:Downloads\boost_1_66_0, I copy static lib libboost_date_time-vc141-mt-gd-x32-1_66.lib from bin.v2\libs\date_time\build\msvc-14.1\debug\link-static\threadapi-win32\threading-multi to my project

and copy all of the headers from C\:Downloads\boost_1_66_0\boost to my project

I am try to include #include "boost/date_time.hpp" with error

error(active) E1696 cannot open source file "boost/cstdint.hpp" ConsoleApplication1 c : \Users\Administrator\source\repos\ConsoleApplication1\ConsoleApplication1\include\boost\date_time\posix_time\posix_time_config.hpp 14 Error(active) E1696 cannot open source file "boost/config/no_tr1/cmath.hpp" ConsoleApplication1 c : \Users\Administrator\source\repos\ConsoleApplication1\ConsoleApplication1\include\boost\date_time\posix_time\posix_time_config.hpp 15 Error(active) E1696 cannot open source file "boost/cstdint.hpp" ConsoleApplication1 c : \Users\Administrator\source\repos\ConsoleApplication1\ConsoleApplication1\include\boost\date_time\time_duration.hpp 12 Error(active) E1696 cannot open source file "boost/operators.hpp" ConsoleApplication1 c : \Users\Administrator\source\repos\ConsoleApplication1\ConsoleApplication1\include\boost\date_time\time_duration.hpp 13 Error(active) E1696 cannot open source file "boost/static_assert.hpp" ConsoleApplication1 c : \Users\Administrator\source\repos\ConsoleApplication1\ConsoleApplication1\include\boost\date_time\time_duration.hpp 14 Error(active) E0169 expected a declaration ConsoleApplication1 c : \Users\Administrator\source\repos\ConsoleApplication1\ConsoleApplication1\include\boost\date_time\time_duration.hpp 289 Error(active) E1696 cannot open source file "boost/cstdint.hpp" ConsoleApplication1 c : \Users\Administrator\source\repos\ConsoleApplication1\ConsoleApplication1\include\boost\date_time\time_resolution_traits.hpp 13 Error(active) E0020 identifier "time_resolution_traits_adapted32_impl" is undefined ConsoleApplication1 c : \Users\Administrator\source\repos\ConsoleApplication1\ConsoleApplication1\include\boost\date_time\time_resolution_traits.hpp 135 Error LNK1104 cannot open file 'libboost_date_time-vc141-mt-sgd-x32-1_66.lib' ConsoleApplication1 C : \Users\Administrator\source\repos\ConsoleApplication1\ConsoleApplication1\LINK 1 
3
  • The missing include files should be self explanatory - it's a common complaint about boost that it has a lot of interdependencies. As for the missing library, you didn't copy it to a place on your link path. Commented Mar 1, 2018 at 1:43
  • after I copy all of the headers from boost to my project, still problem Commented Mar 1, 2018 at 1:44
  • after define #define BOOST_DATE_TIME_NO_LIB is compile success Commented Mar 1, 2018 at 1:54

1 Answer 1

1

after define #define BOOST_DATE_TIME_NO_LIB is compile success

Sign up to request clarification or add additional context in comments.

1 Comment

It's two years later, but you just solved 2 hours of headaches. Thanks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.