加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – Boost :: FileSystem链接问题

发布时间:2020-12-16 07:26:53 所属栏目:百科 来源:网络整理
导读:我在 instructions here之后下载并构建了Windows 7(64位)上的boost库(版本1.47.0). 现在,当我想使用Boost :: Filesystem库时,我可以包含头文件而不会出现问题,它会编译我的代码文件.问题出现在链接上.我收到以下错误; main.obj : error LNK2019: unresolved
我在 instructions here之后下载并构建了Windows 7(64位)上的boost库(版本1.47.0).

现在,当我想使用Boost :: Filesystem库时,我可以包含头文件而不会出现问题,它会编译我的代码文件.问题出现在链接上.我收到以下错误;

main.obj : error LNK2019: unresolved external symbol "class boost::filesystem3::file_status __cdecl boost::filesystem3::detail::status(class boost::filesystem3::path const &,class boost::system::error_code *)" (?status@detail@filesystem3@boost@@YA?AVfile_status@23@AEBVpath@23@PEAVerror_code@system@3@@Z) referenced in function "bool __cdecl boost::filesystem3::exists(class boost::filesystem3::path const &)" (?exists@filesystem3@boost@@YA_NAEBVpath@12@@Z)
main.obj : error LNK2019: unresolved external symbol "private: static class std::codecvt<wchar_t,char,int> const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet(void)" (?wchar_t_codecvt_facet@path@filesystem3@boost@@CAAEAPEBV?$codecvt@_WDH@std@@XZ) referenced in function "public: static class std::codecvt<wchar_t,int> const & __cdecl boost::filesystem3::path::codecvt(void)" (?codecvt@path@filesystem3@boost@@SAAEBV?$codecvt@_WDH@std@@XZ)

(在其他人中)

值得注意的是,当我第一次尝试构建项目时,它说它无法找到.lib文件libboost_filesystem-vc100-mt-1_47.lib.我没有具体告诉它需要该文件所以不确定它是如何计算出来的?无论哪种方式,我将链接器指向正确的目录,然后它给出了上述错误.

有人知道如何解决这个问题吗?谢谢.

编辑:我正在通过eclipse CDT使用VS2010工具链来构建系统.完整的编译命令是

cl /c /EHs /MD /Zi /I"C:Program Files (x86)Microsoft Visual Studio 10.0VCinclude" /I"C:boost_1_47_0" /nologo <SOURCE_FILE>

和链接器命令

link /debug /nologo /libpath:C:Program Files (x86)Microsoft Visual Studio 10.0VClibamd64 /libpath:C:boost_1_47_0stagelib /libpath:C:Program Files (x86)Microsoft SDKsWindowsv7.0ALibx64 /OUT:<EXE_NAME> <OBJECT_FILES>

解决方法

使用address-model = 64 b2命令行开关重建Boost库.这构建了64位库.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读