不能同时包含<boost python =“”>和<boost any =“”> </boost> </boost>

时间:2015-04-04 06:33:10

标签: python c++11 boost

以下程序无法编译

#include <boost/any.hpp>
#include <boost/python.hpp>
int main() {
    return 0;
}

对于OS X上的clang ++,编译器会发出20多个错误,包括

In file included from /Users/strin/OneDrive/Research/Deep Generative Models/code/cibp-net/main.cpp:1:
In file included from /Users/strin/OneDrive/Research/Deep Generative Models/code/cibp-net/inc/npnet.h:5:
In file included from /opt/local/include/boost/python.hpp:11:
In file included from /opt/local/include/boost/python/args.hpp:10:
In file included from /opt/local/include/boost/python/args_fwd.hpp:10:
In file included from /opt/local/include/boost/python/handle.hpp:11:
In file included from /opt/local/include/boost/python/errors.hpp:13:
In file included from /opt/local/include/boost/function/function0.hpp:11:
In file included from /opt/local/include/boost/function/detail/maybe_include.hpp:13:
In file included from /opt/local/include/boost/function/function_template.hpp:13:
In file included from /opt/local/include/boost/function/detail/prologue.hpp:17:
In file included from /opt/local/include/boost/function/function_base.hpp:20:
In file included from /opt/local/include/boost/assert.hpp:84:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:436:15: error: C++ requires a type specifier for all declarations
    char_type toupper(char_type __c) const
              ^~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Headers/pyport.h:731:29: note: expanded from macro 'toupper'
#define toupper(c) towupper(btowc(c))

但是,如果我切换订单并使用

#include <boost/any.hpp>
#include <boost/python.hpp>
int main() {
    return 0;
}

通过编译。

0 个答案:

没有答案