[英]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.