[英]Boost::python with ACE , C++ ambiguous symbol
I am trying to have interface for C++ library for python using boost::python
, my C++ code is using ACE
, now when I include following code 我正在尝试使用boost::python
为python的C ++库提供接口,我的C ++代码正在使用ACE
,现在当我包含以下代码时
#ifdef BUILD_PYTHON_EXT
#include <boost/python.hpp>
using namespace boost::python;
#endif
it is giving me following error 它给我以下错误
1>E:\thirdparty\ace.6.1.0_versioned_vc10\ace/ACE.h(150): error C2872: 'ssize_t' : ambiguous symbol
1> could be 'E:\thirdparty\ace.6.1.0_versioned_vc10\ace/os_include/sys/os_types.h(126) : int ssize_t'
1> or 'E:\thirdparty\boost_1_51_0\boost/python/ssize_t.hpp(15) : boost::python::ssize_t'
How do i resolve this error 我该如何解决这个错误
In this case you should not use using directive. 在这种情况下,您不应使用using指令。 Use namespace python = boost::python
or something else. 使用namespace python = boost::python
或其他名称。 Or, you should include ACE headers, or something that include ACE headers before using namespace boost::python;
或者,在using namespace boost::python;
之前,您应该包括ACE标头,或包含ACE标头的内容using namespace boost::python;
, but first is preferable. ,但首先是可取的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.