catkin_pkg设置的Cython包含错误

问题描述 投票:0回答:1

我使用以下代码从setup.pyhere中提取一个C ++类的python包装器:

## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup

setup_args = generate_distutils_setup(
    packages=['hw_interface_pkg'],
    package_dir={'': 'src'},
    requires=['std_msgs', 'rospy'],
)
setup(**setup_args)

我得到的错误是:

/src/cython/hw_interface.c:482:
/include/remote_hw.h:6:10: fatal error: array: No such file or directory
 #include <array>
          ^~~~~~~

这是标题中的第一个include。在this threadthis threadthis thread之后,主要解决方案似乎是在参数中添加language="c++"。但是,这对我来说并没有解决问题,上面的代码也与那些线程中使用的代码完全不同。 (它使用“ generate_distutils_setup”代替“ cythonize”或“ Extension”。)>

除了[c0]之类的标准c ++以外,还有其他一些我不确定安装程序是否会找到它们。有人可以为此建议一个可能的解决方案吗?这个问题可能实际上源于CMakelists.txt详细信息吗?

我在setup.py中使用以下代码从此处创建c ++类的python包装器:##!不要手动调用此setup.py,请使用distutils.core中的CATKIN INSTEAD,从...

python c++ cython ros include-path
1个回答
0
投票

解决方案是在子CMakeLists.txt中添加如下所示的“ set_source_files_properties”。

© www.soinside.com 2019 - 2024. All rights reserved.