运行提升 bcp 工具时出错:"The Boost path appears to have been incorrectly set"

Error running boost bcp tool: "The Boost path appears to have been incorrectly set"

本文关键字:to appears path have been set incorrectly Boost The 工具 bcp      更新时间:2023-10-16

尝试运行 Boost 的 bcp 工具时,出现以下错误:

**** exception(205): std::runtime_error: The Boost path appears to have been incorrectly set: could not find boost/version.hpp in 
******** errors detected; see standard output for details ********

错误消息与上述完全相同,它尝试搜索的路径为空。我尝试通过设置 BOOST_ROOT 环境变量来解决它,但同样的错误又回来了,搜索的路径仍然为空。系统是Mac OS X 10.9.1。

好的,我通过添加以下命令行选项解决了它:

--boost=/path/to/boost_directory

我天真地认为 bcp 会在应该设置的环境变量中找到此目录,因为文档中的大多数示例都不包含该选项。现在我在文档中看到,如果未指定该选项,"则假定当前路径是 Boost 树的根目录"。

http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/index.html#bcp.syntax.options