c++ - 是我还是Boost Track SVN(Boost Geometry Extension Dissolve)的一部分无法编译?

标签 c++ boost compiler-errors geometry boost-geometry

boost 几何体的溶解 described a bit here , 是我现在需要的,它的 SVN 主页是 here但只要我包括#include <boost/geometry/extensions/algorithms/dissolve.hpp>我遇到编译错误(错误 C4430、C2146 和 C2061)=(任何人都可以提供补丁吗?

可以找到示例代码,例如 here

错误:

Error   2   error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   c:\users\avesta\desktop\cf\trunk\cloudserver\3rdparty\header-only\boost\geometry\extensions\algorithms\dissolve.hpp 67  1   CloudServer

Error   3   error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   c:\users\avesta\desktop\cf\trunk\cloudserver\3rdparty\header-only\boost\geometry\extensions\algorithms\dissolve.hpp 67  1   CloudServer

Error   1   error C2146: syntax error : missing ';' before identifier 'state_type'  c:\users\avesta\desktop\cf\trunk\cloudserver\3rdparty\header-only\boost\geometry\extensions\algorithms\dissolve.hpp 67  1   CloudServer

Error   4   error C2061: syntax error : identifier 'state_type' c:\users\avesta\desktop\cf\trunk\cloudserver\3rdparty\header-only\boost\geometry\extensions\algorithms\dissolve.hpp 76  1   CloudServer

最少的代码看起来像(在 VS2010 上测试失败并出现警告错误):

#include <boost/geometry/extensions/algorithms/dissolve.hpp>

int main()
{
    return 0;
}

最佳答案

它在这里编译对我来说很好(使用 clang 和 gcc):

$ clang++ -I /Volumes/EyeFive/Marshall/Sources/boost/trunk junk.cpp
$ clang++ --version
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.2.0
Thread model: posix
$ g++ -I /Volumes/EyeFive/Marshall/Sources/boost/trunk junk.cpp
$ g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

使用 boost 中继。 您使用的是什么编译器(以及该编译器的哪个版本)?

所以,我想答案是:是你 ;-)

关于c++ - 是我还是Boost Track SVN(Boost Geometry Extension Dissolve)的一部分无法编译?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8055873/

相关文章:

c++ - 为什么 gcc 会在全局命名空间中隐藏重载函数?

c++ - 使用模板化节点的模板化列表类中缺少类型说明符

c++ - 单例的析构函数

c++ - 具有 Python GUI 和 C++ 后台模块的混合应用程序

linux - 1.50的二进制复制

react-native - 如何修复react-native中的“'boost/operators.hpp'文件未找到”错误

c++ - 将 std::unique_ptr 作为参数传递给函数

c++ - 指针右侧的调用约定属性

c++ - 对宽度不匹配的输出缓冲区进行矢量化

c++ - 二进制永远不会构建