c++ - 使用 boost 编译时出错

标签 c++ gcc boost boost-filesystem

我收到这个错误:

  CXX      luascript.o
In file included from /usr/include/boost/filesystem.hpp:15:0,
                 from luascript.cpp:21:
/usr/include/boost/filesystem/config.hpp:16:5: error: #error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
 #   error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
     ^
make[1]: *** [luascript.o] Error 1
make[1]: Leaving directory `/root/src.DEB'
make: *** [all] Error 2

我以前编译过这个,但我不记得见过这个。

luascript.cpp 的第 21 行是 #include <boost/filesystem.hpp>

我该怎么做才能解决这个问题?

我在 Debian 7 上使用最新的软件包和 gcc 4.8.2

最佳答案

您的 LUA 库需要一个(现已过时)旧版本的 Boost 文件系统。

这是 changed in boost 1.50.0 :

Remove Filesystem Version 2 from the distribution. Version 3 is now the only distributed version. Those still using V2 are urged to migrate to V3 as soon as possible.

注意,boost 1.50.0 发布于2012 年 6 月 28 日 12:48 GMT

因此,敦促您的库供应商迁移到 V3 :)

关于c++ - 使用 boost 编译时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21666446/

相关文章:

c - GCC 不优化未初始化静态常量的结构副本

gcc - GCC 生成的 ARM 和 x86 汇编代码的区别

c++ - boost::any 不能转换回 std::function

php preg_match 在 C++ 中与 Boost 的等价物?

c++ - 在 C++ 中创建成员函数名称并在运行时调用它

c++ - sfml中的鼠标位置和点击检测

c++ - 功能参数生命周期

c++ - 错误 : invalid operands of types ‘const char [35]’ and ‘const char [2]’ to binary ‘operator+’

c++ - 将 Tcl 中命令的输出重定向到文件时,文件以 DOS 格式生成

linux - Fedora 下 Firefox 未加载 XPCOM 组件