这是我使用boost进行python扩展的第一次尝试.有人可以帮助我理解导致编译错误的原因吗?
#include
user @ host:$g main.cpp -o test.so
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,from /usr/include/boost/python/module.hpp:8,from main.cpp:8:
/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory compilation terminated.
最佳答案
/usr/include/boost/python/detail/wrap_python.hpp:50:23:
fatal error: pyconfig.h: No such file
or directory compilation terminated.
这一行告诉它为什么不起作用.您的编译器不知道pyconfig.h文件在哪里.你有两个选择:
>将pyconfig.h放在一个位置 g知道(即你的 项目目录) >添加-I DIRECTORY(这是资本i, 不小写L)标志为g 将为头文件搜索DIRECTORY
g++ -I /path/to/my/include/files main.cpp
(编辑:安卓应用网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|