1. 程式人生 > >fatal error:xxx.h no such file or directory 解決方案

fatal error:xxx.h no such file or directory 解決方案

編譯程式的時候遇到了找不到依賴包的問題,找了很多解決方案都沒有解決,最後摸索了很久才解決,把過程記錄下來方便以後用。


碰到這種問題,首先是要找有沒有可安裝的依賴包,命令為:

apt-cache search xxx | grep dev

用dev過濾是因為有時候相關的安裝包有很多,所以過濾一下

過濾之後直接安裝給出的包就好

如果能無錯下載一般就沒有後面的問題了,但是我安裝的時候就碰到了各種問題,比如

The following packages have unmet dependencies:
 lib***-dev : Depends: lib*** (= 5.5.35+dfsg-1ubuntu1) but 5.5.44-0ubuntu0.14.04.1 is to be installed

或者

E: Unable to correct problems, you have held broken packages.

這個時候就很糾結了,因為很多安裝包的依賴關係很複雜,不那麼容易移除後自己重灌

這個時候就有一個很好用的工具了:aptitude

“aptitude與 apt-get 一樣,是 Debian 及其衍生系統中功能極其強大的包管理工具。與 apt-get 不同的是,aptitude在處理依賴問題上更佳一些。舉例來說,aptitude在刪除一個包時,會同時刪除本身所依賴的包。這樣,系統中不會殘留無用的包,整個系統更為乾淨。"

(以上摘自百度百科 http://baike.baidu.com/link?url=EWNdvQzWfGXT2nhQkTCvZ1qfvbjYvOLzt8-Zr5eRf5UED50CBtoSY604AJB9MxG4FkDjYi8njL-Szi1maTBjO_)

裝好aptitude之後,可以試一下命令sudo aptitude update && sudo aptitude install build-essential

之後編譯,若還不能過,可以用aptitude安裝來試一下,仔細看下aptitude給的選項和提示,就可以方便的修復上面的問題了

依賴包安裝好之後,我又碰到了/usr/bin/ld:cannot find -lxxx這樣的問題

如果依賴包已經正確的安裝,出現這個問題很可能是因為連結檔案沒有設定好

這個時候需要cd 到/usr/lib命令下,先用ls+grep把本來的連結庫找出來

然後使用ln命令把lxxx檔案和相應的連結庫連結

經過以上步驟,這個問題應該就能解決了

相關推薦

fatal error:xxx.h no such file or directory 解決方案

編譯程式的時候遇到了找不到依賴包的問題,找了很多解決方案都沒有解決,最後摸索了很久才解決,把過程記錄下來方便以後用。 碰到這種問題,首先是要找有沒有可安裝的依賴包,命令為: apt-cache search xxx | grep dev 用dev過濾是因為有時候相關的安裝包

fatal error: Python.h: No such file or directory 解決

parrot python error pycrypto python.h [常見錯誤] fatal error: Python.h: No such file or directory環境場景系統: Parrot Linux軟件: 系統python默認版本2.7 PyCharm默認版本P

Ubuntu下 fatal error: Python.h: No such file or directory 解決方法

error ID apt overflow AC python3 TE cto fat 參考: fatal error: Python.h: No such file or directory Ubuntu下 fatal error: Python.h: No such f

fatal error: matio.h: No such file or directory

caff nbsp article https details fig onf 1.5 sudo http://blog.csdn.net/zziahgf/article/details/72900948 $ sudo apt-get install libmatio-d

fatal error: pcre.h: No such file or directory

code upd dir ror include class color dev rect /usr/include/php5/ext/pcre/php_pcre.h:29:18: fatal error: pcre.h: No such file or director

plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory

center ext tor jsb iss install all sdn plugin 裝一臺新服務器環境的時候,裝uwsgi報錯: plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such

ubuntu 安裝 regex模塊時 fatal error: Python.h: No such file or directory

rec err log 模塊 python.h sudo ins 根據 post 原因是 python-dev包沒有安裝 根據Py2還是py3 sudo apt-get install python-dev 或者 sudo apt-get install python3-d

解決 Boost安裝:fatal error: bzlib.h: No such file or directory 問題

++ gpo sku fat .cpp post src lib thread 參考: How to install all the boost development libraries? 解決 Boost安裝:fatal error: bzlib.h: No such

安裝MySQLdb模塊遭遇"fatal error: my_config.h: No such file or directory"的處理

fresh nag fir () ron rpm -e 64bit rst col Issue I encountered an error when I run the python script which need to import the modu

Solve fatal error: helper_math.h: No such file or directory

director install nbsp cal oca style color sam col When the ‘fatal error: helper_math.h: No such file or directory‘ occurs, it means th

Centos7.5 PHP7.2 連線sql_server 遇到fatal error: sql.h: No such file or directory

FreeTD的安裝過程這裡就不寫,以免囉嗦。 下面要講的是PHP的sql server 拓展安裝。 php5.6等老版本預設帶mssql的擴充套件,但php7.1以上就沒有,所以需要手動下載並編譯。 pdo_sqlsrv擴充套件包 http://pecl.php.net/pac

COCO API: fatal error: Python.h: No such file or directory

我的系統為ubuntu 16.04 今天我在安裝tensorflow objection detection api的cocoapi的時候出現了下面的問題: x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstr

caffe編譯:fatal error: pyconfig.h: No such file or directory #include "pyconfig.h“編譯protobuf

sudo make clean sudo make all -j8 報錯 CXX tools/caffe.cpp In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,

解決fatal error: Python.h: No such file or directory

在ubuntu14.04 下安裝python的 netifaces包時遇到fatal error: Python.h: No such file or directory問題 首先檢視/user/include/python2.x目錄,是否包含Python.h,如果有的話可能是pyth

./include/caffe/data_layers.hpp:9:18: fatal error: hdf5.h: No such file or directory

再次編譯,報錯:src/caffe/layers/hdf5_data_layer.cpp:13:18: fatal error: hdf5.h: No such file or directory #include "hdf5.h"記得上面已經安裝了hdf5-devel,怎

linux Ubuntu C++:“fatal error: iostream.h: No such file or directory

所以,新的標準是:#include <iostream>  //標準輸入輸出流 using namespace std; (因為iostream宣告在std中,故而要加上這句,除非你不用庫函式,否則錯誤); 很多編譯器都同時支援這兩種標頭檔案形式,更好的當然是標準標頭檔案。至於為什麼不廢除非標準

fatal error: nsync_cv.h: No such file or directory

此文僅關於Faster-RCNN_TF第一步 先將(你的環境路徑)lib/python2.7/site-packages/tensorflow/include/tensorflow/core/platform沒有使用anaconda的路徑類似下面:/usr/local/lib

tesseract的編譯安裝 tesseract編譯錯誤:fatal error: allheaders.h: No such file or directory

    需要安裝: <span style="font-family:'Microsoft YaHei';font-size:14px;">apt-get install autoconfapt-get install automakeapt-get install li

用hyperscan-python時,fatal error: Python.h: No such file or directory

1、centos7.3用hyperscan-python時報錯:fatal error: Python.h: No such file or directory 系統中沒有python.h的原因,是因為沒有安裝python的開發版,即Python-devel這個包,命

關於安裝MySQLdb出現fatal error: my_config.h: No such file or directory

今天在安裝python的模組MySQLdb時,在編譯原始碼時,一直出現一個錯誤,下面是編譯資訊: running build running build_py creating build creating build/lib.linux-x86_64-2.7 cop