繁体   English   中英

用python增强编译错误

[英]Boost compilation error with python

我是Boost C ++库的新手,我正尝试在Python中使用boost。 每当我编译简单的测试程序时,都会出现错误:

error: pyconfig.h: No such file or dirctory 

(紧随其后的是我确信是由于缺少此标头的数千个错误)。 我从其网站下载了boost,然后构建了库。 我仍然不知道为什么该文件丢失以及如何获取。 请帮忙!

我使用的是Code :: blocks MinGW编译器,我已将代码块指向boost文件夹,作为标头和库的搜索目录。 这是我的简单程序:

#include <boost/python.hpp>

using namespace boost::python;

int main()
{
    Py_Initialize();
    PyRun_SimpleString("from time import time,ctime\n"
                        "print ’Today is’,ctime(time())\n");
    Py_Finalize();
    return 0;
}

您的包含路径中显然没有CPython标头。 仅使用boost::python是不够的,您还需要Python本身。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM