在Windows上仅使用Boost.DateTime和错误
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Windows上仅使用Boost.DateTime和错误相关的知识,希望对你有一定的参考价值。
我使用b2.exe编译Boost.DateTime:
.2.exe install --with-date_time link=static runtime-link=static
它在bin.v2
中创建C:Downloadsoost_1_66_0
目录,我将libboost_date_time-vc141-mt-gd-x32-1_66.lib
中的静态库bin.v2libsdate_timeuildmsvc-14.1debuglink-static hreadapi-win32 hreading-multi
复制到我的项目中
并将C:Downloadsoost_1_66_0oost
中的所有标题复制到我的项目中
我试图包含#include "boost/date_time.hpp"
错误
error(active) E1696 cannot open source file "boost/cstdint.hpp" ConsoleApplication1 c : UsersAdministratorsource
eposConsoleApplication1ConsoleApplication1includeoostdate_timeposix_timeposix_time_config.hpp 14
Error(active) E1696 cannot open source file "boost/config/no_tr1/cmath.hpp" ConsoleApplication1 c : UsersAdministratorsource
eposConsoleApplication1ConsoleApplication1includeoostdate_timeposix_timeposix_time_config.hpp 15
Error(active) E1696 cannot open source file "boost/cstdint.hpp" ConsoleApplication1 c : UsersAdministratorsource
eposConsoleApplication1ConsoleApplication1includeoostdate_time ime_duration.hpp 12
Error(active) E1696 cannot open source file "boost/operators.hpp" ConsoleApplication1 c : UsersAdministratorsource
eposConsoleApplication1ConsoleApplication1includeoostdate_time ime_duration.hpp 13
Error(active) E1696 cannot open source file "boost/static_assert.hpp" ConsoleApplication1 c : UsersAdministratorsource
eposConsoleApplication1ConsoleApplication1includeoostdate_time ime_duration.hpp 14
Error(active) E0169 expected a declaration ConsoleApplication1 c : UsersAdministratorsource
eposConsoleApplication1ConsoleApplication1includeoostdate_time ime_duration.hpp 289
Error(active) E1696 cannot open source file "boost/cstdint.hpp" ConsoleApplication1 c : UsersAdministratorsource
eposConsoleApplication1ConsoleApplication1includeoostdate_time ime_resolution_traits.hpp 13
Error(active) E0020 identifier "time_resolution_traits_adapted32_impl" is undefined ConsoleApplication1 c : UsersAdministratorsource
eposConsoleApplication1ConsoleApplication1includeoostdate_time ime_resolution_traits.hpp 135
Error LNK1104 cannot open file 'libboost_date_time-vc141-mt-sgd-x32-1_66.lib' ConsoleApplication1 C : UsersAdministratorsource
eposConsoleApplication1ConsoleApplication1LINK 1
答案
定义#define后BOOST_DATE_TIME_NO_LIB编译成功
以上是关于在Windows上仅使用Boost.DateTime和错误的主要内容,如果未能解决你的问题,请参考以下文章
如何在 Windows 上仅安装 PostgreSQL 的客户端工具?
避免在 Redshift 上仅向日期时间字段提供时间时使用默认日期值