问题标签 [boost-filesystem]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
1221 浏览

boost-filesystem - boost 1.48 filesystem3 符号链接错误问题

我的项目设置: /I"..\ANTLR_LIB" /I"..\eNITL" /I"......\boost" /ZI /nologo /W3 /WX- /MP /Od /Oy- /D "WIN32" /D "_D​​EBUG" /D "_CONSOLE" /D "_VC80_UPGRADE=0x0710" /D "_UNICODE" /D "UNICODE" /D "BOOST_USE_WINDOWS_H" /GF- /Gm- /EHsc /RTC1 /MTd /GS / Gy /fp:precise /Zc:wchar_t /Zc:forScope /Yu"StdAfx.h" /Fp"Debug\PIDL_UnProtect.pch" /Fa"Debug\" /Fo"Debug\" /Fd"Debug\vc100.pdb" /Gz /wd"4996" /analyze- /errorReport:queue

链接提升库:

boost\bin.v2\libs\system\build\msvc-10.0\debug\link-static\runtime-link-static\threading-multi\libboost_system-vc100-mt-sgd-1_48.lib boost\bin.v2\libs \filesystem\build\msvc-10.0\debug\link-static\runtime-link-static\threading-multi\libboost_filesystem-vc100-mt-sgd-1_48.lib

但是发生了这个错误。什么问题??

错误 LNK2019:未解析的外部符号“void __stdcall boost::filesystem3::path_traits::convert(char const *,char const *,class std::basic_string,class std::allocator > &,class std::codecvt const &) " (?convert@path_traits@filesystem3@boost@@YGXPBD0AAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@ABV?$codecvt@_WDH@5@@ Z) 在函数“void __stdcall boost::filesystem3::path_traits::dispatch,class std::allocator > >(class std::basic_string,class std::allocator > const &,class std::basic_string,class std ::allocator > &,class std::codecvt const &)"(??$dispatch@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@path_traits@filesystem3@boost@@YGXABV?$basic_string@DU?$ char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@4@ABV?$ codecvt@_WDH@4@@Z) 3>PIDL.obj : error LNK2001: unresolved external symbol "void __stdcall boost::filesystem3::path_traits::convert(char const *,char const *,class std::basic_string,class std::allocator > &,class std::codecvt const &)" (?convert@path_traits@filesystem3@boost@@YGXPBD0AAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2 @@std@@ABV?$codecvt@_WDH@5@@Z) 3>Backend.obj:错误 LNK2019:未解析的外部符号“void __stdcall boost::filesystem3::path_traits::convert(wchar_t const *,wchar_t const * ,类std::basic_string,类std::allocator > &,类 std::codecvt const &)" (?convert@path_traits@filesystem3@boost@@YGXPB_W0AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV? $codecvt@_WDH@5@@Z) 在函数“public: class std::basic_string,class std::allocator > const __thiscall boost::filesystem3::path::string(class std::codecvt const &)const 中引用" (?string@path@filesystem3@boost@@QBE?BV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$codecvt@_WDH@5 @@Z) 3>PIDL.obj : error LNK2001: unresolved external symbol "void __stdcall boost::filesystem3::path_traits::convert(wchar_t const *,wchar_t const *,class std::basic_string,class std::allocator > &,类 std::codecvt const &)"(?convert@path_traits@filesystem3@boost@@YGXPB_W0AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$codecvt@_WDH@5@@Z ) 3>Backend.obj : error LNK2019: unresolved external symbol "private: static class std::codecvt const * & __stdcall boost::filesystem3::path::wchar_t_codecvt_facet(void)" (?wchar_t_codecvt_facet@path@filesystem3@boost@ @CGAAPBV?$codecvt@_WDH@std@@XZ) 在函数“public: static class std::codecvt const & __stdcall boost::filesystem3::path::codecvt(void)”(?codecvt@path@filesystem3@ boost@@SGABV?$codecvt@_WDH@std@@XZ) 3>PIDL.obj:错误 LNK2001:未解析的外部符号“私有:静态类 std::codecvt const * & __stdcall boost::filesystem3::path::wchar_t_codecvt_facet (空白)”(?wchar_t_codecvt_facet@path@filesystem3@boost@@CGAAPBV?$codecvt@_WDH@std@@XZ) 3>PIDL.obj : 错误 LNK2019: 未解析的外部符号 "class boost::filesystem3::file_status __stdcall boost::filesystem3: :detail::status(class boost::filesystem3::path const &,class boost::system::error_code *)" (?status@detail@filesystem3@boost@@YG?AVfile_status@23@ABVpath@23@PAVerror_code @system@3@@Z) 在函数 "bool __stdcall boost::filesystem3::exists(class boost::filesystem3::path const &)" (?exists@filesystem3@boost@@YG_NABVpath@12@@Z) 中引用3>PIDL.obj:错误 LNK2019:未解析的外部符号“bool __stdcall boost::filesystem3::detail::create_directory(class boost::filesystem3::path const &,class boost::system::error_code *)”(?create_directory@detail@filesystem3@boost@@YG_NABVpath@23@PAVerror_code@system@3@@Z) 在函数“bool __stdcall boost::filesystem3::create_directory(class boost::filesystem3::path const &)”中引用(?create_directory@filesystem3@boost@@YG_NABVpath@12@@Z) 3>PIDL.obj : error LNK2019: unresolved external symbol "class boost::filesystem3::path __stdcall boost::filesystem3::detail::initial_path(class boost::system::error_code *)" (?initial_path@detail@filesystem3@boost@@YG?AVpath@23@PAVerror_code@system@3@@Z) 在函数 "class boost::filesystem3::path __stdcall boost 中引用::filesystem3::initial_path(void)" (?initial_path@filesystem3@boost@@YG?AVpath@12@XZ) 3>PIDL.obj : error LNK2019: unresolved external symbol "bool __stdcall boost::filesystem3::detail: :remove(class boost::filesystem3::path const &,class boost::system::error_code *)" (?remove@detail@filesystem3@boost@@YG_NABVpath@23@PAVerror_code@system@3@@Z) 在函数“bool __stdcall boost::filesystem3: :remove(class boost::filesystem3::path const &)" (?remove@filesystem3@boost@@YG_NABVpath@12@@Z) 3>PIDL.obj : error LNK2019: unresolved external symbol "void __stdcall boost::filesystem3 ::detail::directory_iterator_construct(class boost::filesystem3::directory_iterator &,class boost::filesystem3::path const &,class boost::system::error_code *)" (?directory_iterator_construct@detail@filesystem3@boost@@ YGXAAVdirectory_iterator@23@ABVpath@23@PAVerror_code@system@3@@Z) 在函数“public: __thiscall boost::filesystem3::directory_iterator::directory_iterator(class boost::filesystem3::path const &)”中引用(??0directory_iterator@filesystem3@boost@@QAE@ABVpath@12@@Z) 3>PIDL.obj : 错误 LNK2019: 无法解析的外部符号 "void __stdcall boost::filesystem3::detail::directory_iterator_increment(class boost::filesystem3 ::directory_iterator &,class boost::system::error_code *)" (?directory_iterator_increment@detail@filesystem3@boost@@YGXAAVdirectory_iterator@23@PAVerror_code@system@3@@Z) 在函数“private: void __thiscall boost: :filesystem3::directory_iterator::increment(void)" (?increment@directory_iterator@filesystem3@boost@@AAEXXZ) 3>PIDL.obj : 错误 LNK2019: 无法解析的外部符号 "class boost::system::error_code __stdcall boost::函数“public:__thiscall boost::filesystem3::detail::dir_itr_imp::~dir_itr_imp(void)" (??1dir_itr_imp@detail@filesystem3@boost@@QAE@XZ) 3>stdafx.obj : error LNK2019: unresolved external symbol "class boost ::system::error_category const & __stdcall boost::system::generic_category(void)" (?generic_category@system@boost@@YGABVerror_category@12@XZ) 在函数“void __cdecl boost::system::”中引用dynamic initializer for 'posix_category''(void)" (??__Eposix_category@system@boost@@YAXXZ) 3>stdafx.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & __stdcall boost::system::system_category(void)" (?system_category@system@boost@@YGABVerror_category@12@XZ) referenced in function "void __cdecl boost::system::'native_ecat''(void)" (??__Enative_ecat@system@boost@@YAXXZ) 的动态初始化程序

0 投票
2 回答
2394 浏览

c++ - Boost 过程中缺少异常

我想使用 Boost Process,尽管它还没有发布。我做了

添加boost-process到包含路径(-I),#included <boost/process.hpp>但编译抱怨filesystem_error未定义:

我尝试将命名空间更改为boost::filesystem3但结果相同。

的定义filesystem_error

BOOST_SYMBOL_VISIBLE隐藏了吗?

0 投票
2 回答
2637 浏览

c++ - 使用qt模板时无法解析外部?

嗨,我正在使用 Visual Studio 2010。我添加了 Qt 插件以及手动构建最后一个 boost 包。现在我开始了一个新项目,一个qt窗口应用程序。

在那里我使用了以下代码:

但是,这似乎失败了。当我使用完全相同的代码但不使用 qt 模板时,它可以工作。确切的错误如下:

我试图研究明显的设置;但是在项目属性中,boost库目录仍然位于VC++目录->库目录下

这是什么原因造成的?我该如何解决这个问题?

0 投票
1 回答
3348 浏览

c++ - Boost文件系统完全替换

我的旧 Boost 代码:

在新的 Boost 版本中,这仅使用#define BOOST_FILESYSTEM_VERSION 2. complete新 Boost 版本中的替换是什么?

0 投票
1 回答
390 浏览

c++ - 提升文件系统 3 路径包含检查

我正在使用 boost 文件系统库,并且有两个路径,我需要知道是否有一种优雅的方法来检查 path1 是否是 path2 的子节点(例如 path1 = /usr/local,path2 = /usr)。我可以通过使用字符串函数来做到这一点,但我想知道是否有使用 boost 文件系统函数的方法。我可以用路径迭代器做到这一点,这是唯一的方法吗?是否有一些辅助功能可以检查?我搜索了文档,但找不到任何东西。谢谢

0 投票
1 回答
2936 浏览

c++ - 无法将 Boost 路径迭代器转换为字符串

我正在尝试从nmdepend获取以下代码进行编译

但是它正在生成以下编译器错误

应该如何修改此代码以便返回一个字符串,同时维护使用迭代器尝试的操作?

0 投票
2 回答
2354 浏览

xcode - 在 XCode 3.2 (MacPorts) 中链接 Boost 文件系统

我正在使用 XCode 3.2 并已使用 MacPorts 项目(发布和调试)安装了 boost,但是我无法让我的应用程序与 boost::filesystem 链接

我已将我的库搜索路径设置为 /opt/local/lib,但在链接项目时我仍然得到未解析的引用。

我在另一篇文章中注意到将 -lboost_system 添加到“其他链接器标志”,但是当我这样做时,我得到 - libboost_system.dylib,文件是为不受支持的文件格式构建的,它不是被链接的体系结构(i386)。

MacPorts 没有安装正确的库还是我错过了其他东西?

马丁

0 投票
2 回答
12273 浏览

c++ - 如何使用 c++ boost 库获取文件权限?

我正在做一个项目来创建我在当前目录中的文件的数据库。我想要的关于我的文件的详细信息之一是在 ubuntu 中使用 chmod 设置的文件权限。(请注意:我也需要组和所有者信息——比如 chown——如果你能告诉我 boost 是否也可以检索所有权信息,那就太好了。)

我正在使用 boost 文件系统库,我已经检查了很多次文档,但找不到如何获取权限。

在此页面中,它显示有enum perms文件权限字符串未显示在我自己的 filesystem.hpp 上。(并且我已经检查过我有 1.49 版本,为了确定也是从源代码构建的)。同样在同一页面上,它显示它可以获得以下权限:

我找不到权限函数,也找不到存储权限列表的位置。

这是我到目前为止的代码(实际上来自 boost 教程,但我将其修改为递归),如果您能告诉我如何获取文件权限/所有权或建议其他库而不是 boost,我将不胜感激。

编辑:我已按照 ethan_liou 的建议添加了 s.permissions() 但输出不如预期。这是更新的代码和输出。

输出:

27746424350注意:每次执行程序时,这些数字都会发生变化。

0 投票
2 回答
4175 浏览

c++ - 尝试使用 Boost.Filesystem 但它似乎没有链接?

我正在使用 OS X 10.7.3。我已经玩了一段时间的 boost 标头,我想继续使用 Boost.Filesystem 库,但是它一直向我抛出这个消息:

当我尝试使用它进行编译时,我得到了这个:

所以我回到了 boost.org 教程并尝试了正则表达式示例。使用它完美地工作:

0 投票
1 回答
1964 浏览

c++ - 成功执行 boost::filesystem::last_write_time 需要哪些权限?

这个简单的代码:

directory如果用户拥有的路径不是执行代码的用户,则抛出“不允许操作”异常。

我对此感到有些困惑,因为我正在处理具有777rwxrwxrwx权限的目录,并且我可以通过touch在 shell 中使用轻松更改它们的修改时间。

我错过了什么吗?Boost 是否要求比它需要的更多权限?有没有办法解决这个问题?

这是Boost中的相关代码: