繁体   English   中英

链接到Boost库时遇到问题(Visual Studio 2013中的C ++)

[英]Having issues with linking to boost library (C++ in Visual Studio 2013)

我已经为此努力了几天。 我尝试下载并编译最新的Boost 1.67.0,以包括

#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/process.hpp>

但是在尝试编译时出现了以下错误(我注意到的一件事是该路径在错误日志中的斜线走错了方向,我不确定该如何解决?

我尝试使用标准cmd以及Visual Studio 2013提示符进行编译(结果相同)。

然后,我尝试从boost网站获取预编译版本

boost_1_67_0-msvc-12.0-32.exe

而且仍然遇到同样的问题。 #include文本未在编辑器中加下划线。 我还有其他包含目录,它们指向:

C:\VisualStudioLibraries\boost_1_67_0

和链接器其他库目录到

C:\VisualStudioLibraries\boost_1_67_0\stage\lib

有谁知道如何解决这个问题? 如果我注释掉#include行以增强代码,则代码编译不会出现任何问题,并且程序会运行。 我的代码还没有使用boost中的任何东西,所以其中唯一与boost相关的东西是3 #include行。

错误是:

1> MyForm.cpp 1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(65):错误C3646:'noexcept':未知的覆盖说明符1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(72):错误C2660:'boost :: process :: process_error :: process_error':函数没有2个参数1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp( 77):错误C2660:'boost :: process :: process_error :: process_error':函数不接受2个参数1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(82):错误C2440: '':无法从'std :: error_code'转换为'boost :: process :: process_error'1>没有构造函数可以采用源类型,或者构造函数重载解析度不明确1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process /detail/config.hpp(88):错误C2440:'':无法从'const std :: error_code'转换为'boost :: process :: process_error'1>没有构造函数可以采用源类型,或构造函数重载r esolution模棱两可1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(94):错误C2660:'boost :: process :: process_error :: process_error':函数没有2个参数1> C :\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(97):错误C2146:语法错误:缺少';' 标识符'Char'之前1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(97):错误C2146:语法错误:缺少';' 标识符'null_char'之前1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(97):错误C4430:缺少类型说明符-假定为int。 注意:C ++不支持default-int 1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(98):错误C2144:语法错误:'char'应该以';'开头 1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(98):错误C2143:语法错误:缺少';' 在'<'1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(99)之前:错误C2143:语法错误:缺少';' 在'{'1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(99)之前:错误C2447:'{':缺少函数标头(旧式正式列表?)1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(101):错误C2146:语法错误:缺少';' 标识符'Char'之前1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(101):错误C2146:语法错误:缺少';' 标识符'equal_sign'之前1> C:\\ VisualStudioLibraries \\ boost_1_67_0 \\ boost / process / detail / config.hpp(101):错误C4430:缺少类型说明符-假定为int。 注意:C ++不支持default-int ==========生成:0成功,1失败,0最新,跳过0 ==========

非常感谢大家。

好吧,我确定这不是大多数人想要听到的答案,但是在尝试了一周以上使其正常工作之后,最终工作的唯一方法是转到Visual Studio2017。所有内容在此处进行链接和编译都很好。 也许我的VS2013安装存在问题(但其他所有操作都可以正常工作)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM