久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Ubuntu - 鏈接 boost.python - 致命錯(cuò)誤:找不到 pyconfi

Ubuntu - Linking boost.python - Fatal error: pyconfig cannot be found(Ubuntu - 鏈接 boost.python - 致命錯(cuò)誤:找不到 pyconfig)
本文介紹了Ubuntu - 鏈接 boost.python - 致命錯(cuò)誤:找不到 pyconfig的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

遇到一些問(wèn)題,現(xiàn)在我已閱讀以下內(nèi)容:

Having some issues, now I have read the following:

hello world python 擴(kuò)展在 C++ 中使用 boost?

我已經(jīng)嘗試將 boost 安裝到我的桌面上,并且按照鏈接方面的建議完成.我有以下代碼:

I have tried installing boost onto my desktop, and, done as the posts suggested in terms of linking. I have the following code:

#include <boost/python.hpp>
#include <Python.h>
using namespace boost::python;

現(xiàn)在我嘗試與以下鏈接:

Now I have tried linking with the following:

g++ testing.cpp -I /usr/include/python2.7/pyconfig.h -L /usr/include/python2.7/Python.h
-lpython2.7

我也嘗試了以下方法:

g++ testing.cpp -I /home/username/python/include/ -L /usr/include/python2.7/Python.h -lpython2.7

我不斷收到以下錯(cuò)誤:

/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such   
file or directory
# include <pyconfig.h>

我不知道我哪里出錯(cuò)了.我確實(shí)安裝了 boost.python,只是鏈接有問(wèn)題?

I don't know where I am going wrong. I do have boost.python installed, there's just a problem linking?

推薦答案

我剛遇到同樣的錯(cuò)誤,問(wèn)題是 g++ 找不到 pyconfig.h(令人震驚,我知道).對(duì)我來(lái)說(shuō),這個(gè)文件位于 /usr/include/python2.7/pyconfig.h 所以附加 -I/usr/include/python2.7/ 應(yīng)該修復(fù)它,或者,您可以使用以下命令將目錄添加到您的路徑中:

I just had the same error, the problem is g++ can't find pyconfig.h(shocking, I know). For me this file is located in /usr/include/python2.7/pyconfig.h so appending -I /usr/include/python2.7/ should fix it, alternatively you can add the directory to your path with:

export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/include/python2.7/"

您也可以將它添加到您的 .bashrc 中,它會(huì)在您下次啟動(dòng) shell 時(shí)添加(您必須重新打開(kāi)終端才能實(shí)現(xiàn)更改).

You can also add this to your .bashrc and it will be added whenever you start your shell next(you will have to reopen your terminal to realize the changes).

您可以使用 find/usr/include -name pyconfig.h 找到自己的 python 包含路徑,在我的情況下返回:

You can find your own python include path by using find /usr/include -name pyconfig.h, in my case this returns:

/usr/include/python2.7/pyconfig.h
/usr/include/i386-linux-gnu/python2.7/pyconfig.h

這篇關(guān)于Ubuntu - 鏈接 boost.python - 致命錯(cuò)誤:找不到 pyconfig的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

What do compilers do with compile-time branching?(編譯器如何處理編譯時(shí)分支?)
Can I use if (pointer) instead of if (pointer != NULL)?(我可以使用 if (pointer) 而不是 if (pointer != NULL) 嗎?)
Checking for NULL pointer in C/C++(在 C/C++ 中檢查空指針)
Math-like chaining of the comparison operator - as in, quot;if ( (5lt;jlt;=1) )quot;(比較運(yùn)算符的數(shù)學(xué)式鏈接-如“if((5<j<=1)))
Difference between quot;if constexpr()quot; Vs quot;if()quot;(“if constexpr()之間的區(qū)別與“if())
C++, variable declaration in #39;if#39; expression(C++,if 表達(dá)式中的變量聲明)
主站蜘蛛池模板: 日韩精品一区二区三区在线观看 | 亚洲资源站 | 亚洲欧洲日本国产 | 久久精品成人一区 | 成人欧美一区二区三区 | 国产91精品在线 | 久久国产精品一区二区三区 | 国产精品99久久久久久久久 | 欧美精品一二三区 | 在线观看国产视频 | 日本不卡一区二区三区 | 国产视频三级 | 欧美天堂在线 | 日日草夜夜草 | 精品国产乱码久久久久久丨区2区 | 九九热在线观看 | 色在线看| 欧美日韩亚洲二区 | 黄色一级电影免费观看 | 91久久久久久久 | 999免费网站 | 日韩三级在线观看 | 日韩欧美国产精品一区二区三区 | 国产精品一区二区av | 在线国产小视频 | 国产精品久久久精品 | 天天夜干| 久久国产成人 | 91九色porny首页最多播放 | 亚洲va欧美va人人爽午夜 | 国产精品一区二区久久 | 亚洲欧美国产毛片在线 | 国产精品欧美日韩 | 欧美成人h版在线观看 | 成人av免费 | 色吧综合 | 亚洲国产一区二区在线 | 亚洲网站免费看 | 精品国产乱码久久久久久1区2区 | 91高清免费 | 欧美精品在线观看 |