1

Boost geometry 的溶解在这里描述了一点,这是我现在需要的,它的 SVN 主页就在这里,但是一旦我加入#include <boost/geometry/extensions/algorithms/dissolve.hpp>我就会得到编译错误(错误 C4430、C2146 和 C2061)=(任何人都可以提供补丁吗?

示例代码可以在这里找到例如

错误:

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;
}
4

2 回答 2

2

它在这里对我来说编译得很好(使用 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.

使用增压后备箱。您使用的是什么编译器(以及该编译器的哪个版本)?

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

于 2011-11-09T02:25:29.280 回答
1

boost 主干分支是开发分支,并不总是编译。事实上,它的状态每小时都在变化。如果您想要稳定且可编译的代码,请使用标签分支之一,例如:http ://svn.boost.org/svn/boost/tags/release/Boost_1_47_0 。

于 2011-11-08T19:40:48.197 回答