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

时间:2011-11-08 19:18:30

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

Boost geometry的消解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;
}

2 个答案:

答案 0 :(得分: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.

使用升压干线。 您使用什么编译器(以及该编译器的哪个版本)?

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

答案 1 :(得分:1)

boost trunk分支是开发分支,并不总是编译。事实上,它的状态每小时都会发生变化。如果您需要稳定且可编译的代码,请使用其中一个标记分支,例如:http://svn.boost.org/svn/boost/tags/release/Boost_1_47_0