導航:首頁 > 文件管理 > GCC找不到庫文件怎麼辦

GCC找不到庫文件怎麼辦

發布時間:2023-05-26 15:58:18

⑴ gcc調試找不到文件

沒有找到目錄 就是源文件和gcc不在一個目錄下 可以用makefile里的vpath來指定源文件所在文件夾

⑵ mips GCC ld 的問題 在指定的目錄下有那個庫,單體是不能找到,很怪異的一個問題!

你這個問題是一個對初學者非常普遍的問題,在這里你需要了解動態載入庫的工作方式和以及ldconfig的用法。-L 表示庫路徑,-l 表示載入的庫。首先,請自已查看這些庫文件是否存在。注意文件與-l後面的文件名不同。比如上面的 -lmainPpDrv,表示載入庫 libmainPpDrv.so這個庫,後面的類似。具體的 gcc -l的用法你自己去查。在保證庫文件都存的情況下,第二步是理解動態載入庫的工作方式。具體四個方式來解決你的問題,最直接的方式,是把剛才找到的庫文件入到/usr/lib下面,然後再ldconfig 一下。注意ldconfig 要用root許可權下運行,如果找不到該命令,那就使用/sbin/ldconfig .第二種,在root 許可權下, vi /etc/ld.so.conf文件,把
/home/leizi/mvswitch/src 作為一行回到該文件中。 然後再ldconfig 一個. 第三種方法,使用LD_LIBRARY_PATH . 在終端下,輸入 LD_LIBRARY_PATH=/home/leizi/mvswitch/src export LD_LIBRARY_PATH. 第四種方法: 在你上面的編譯最後添加 -Wl,-rpath=/home/leizi/mvswitch/src 就可以了。另外再多說了一句,你的-L後面的路徑都是一樣的,因而可能只寫一個就行,寫的位置不限,只要在gcc 之後。
如需知道動態庫的載入方式,我有詳細的總結。如有疑問:QQ:524914698

⑶ 請問如何才能讓gcc找到非標准庫文件

在編譯時指定這個頭文悔型脊件試下。-I/usr/incled/mpi 一般來說碧滲租喊,/usr/include是gcc的默認頭文件路徑

⑷ 為什麼使用gcc編譯時總顯示找不到文件

gcc -o 後面跟輸出文件的名字
gcc -o hello hello.c 這樣子的
格式不對吧
比如編譯hello.c

可以輸入:
gcc hello.c -o hello

⑸ GCC找不到庫文件

。。。
gcc -o main -L/home/源培激eddy/雹襪test main.o -L/home/eddy/test/中春out -leddy -ltest試試

⑹ 用gcc編程,為什麼提示找不到文件(No such file or direction) 或是bash:gcc- :command not found

1. C源文件要使用.c擴展名。
2. 可能是系統沒有安裝gcc。在shell下輸入
which gcc查看是否安版裝gcc
3. 假設需要編權譯/home/myname目錄下的t.c文件,在/home/myname目錄下輸入
gcc t.c -o t
編譯得到的可執行文件則保存為文件t

linux 中用gcc編譯通過 用arm-lunx-gcc編譯提示缺少庫文件

先用交叉編譯工具編譯openssl庫羨源,然後在你程序的Makefile里指定openssl頭文件和庫的位置(-I 和 -L),然後編譯就可以了。運行時別忘了把openssl的兄余態庫也放到開發板毀族中。

⑻ Linux下編譯.c文件時sqlite3找不到庫文件如何解決(undefined reference to `sqlite3_open')

建議最好寫個makefile,包含上庫段告陵文件
動態的路徑一般是/usr/lib/握戚
靜態庫一般可能是安友氏裝目錄
可以試試rmp -q
或者find / -name
sqlite3

⑼ linux下 gcc可以編譯hello.c arm-linux-gcc 無法找到libz.so.1

arm編譯器的庫文件在編譯器包裡面,路徑和系統gcc的那個不一樣,去交叉編譯鏈包裡面找去吧,如果找不到那就真沒有了。

⑽ gcc交叉編譯怎麼找頭文件及lib庫的

是在specs裡面讀取的路徑信息。
命令行中鍵入 gcc -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/configure --ver
bose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libe
xecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-langu
ages=c,ada,c++,d,f77,pascal,java,objc --enable-nls --without-included-gettext --
enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java-
awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-thre
ads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptio
ns --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)

注意「--prefix=/usr」 以及「--libdir=/usr/lib 」
表示gcc ld as 等可執行文件安裝在/usr/bin,而libc.a 等文件是在/usr/lib中。
解壓縮交叉編譯器時,也是要解壓縮在在--prefix 指定的目錄下。
比如 下載了arm-linux 的交叉編譯器cross-3.3.2.tar.bz2,解壓縮之後,運行 arm-linux-gcc -v
得到 --prefix=/usr/local/arm。那麼就要把 bin lib 等所有的文件和文件夾到/usr/local/arm目錄下。
否則到時候運行arm-linux-gcc hello.c會提示找不到stdio.h 或者 lib.so.6 等

HOWTO Use the GCC specs file

About Specs file
The "gcc" program invoked by users is a convenient front-end driver executable which will invoke other programs in the background such as cc1, as or ld to do its work according to the command line parameter given. A specs file is plain text used to control the default behavior for the "gcc" front-end. The specs file is usually built-in but for flexibility purposes, it can be overridden with an external version.
Basic Specs file modifications
CC will proce a specs file via the following command.
gcc -mpspecs > specs
You may use a text editor of your choice to inspect it. It may be confusing at first, but there are many places of interest. To use the specs file, invoke gcc with -specs= or place it at "/mingw/lib/gcc/mingw32//specs" to make GCC use it by default, where refers to the GCC version installed.
Adding include directories to the search path
& #160;he *cpp: section should be modified. It contains the following by default:
*cpp:
%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT}
If "z:\libx\include" needs to be added to the GCC includes search path, it should be changed to the following
*cpp:
%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} -I/z/libx/include
Adding lib directories to the search path
& #160;he *link_libgcc: section should be modified. It contains the following by default:
*link_libgcc:
%D
& #160;f "z:\libx\lib" needs to be added to the GCC library search path, it should be changed to the following
*link_libgcc:
%D -L/z/libx/lib

閱讀全文

與GCC找不到庫文件怎麼辦相關的資料

熱點內容
最新網路衛星導航如何使用 瀏覽:425
以下哪些文件屬於圖像文件 瀏覽:774
zycommentjs 瀏覽:414
確認全血細胞減少看哪些數據 瀏覽:265
文件有哪些要求 瀏覽:484
cad打開時會出現兩個文件 瀏覽:65
什麼是轉基因網站 瀏覽:48
手柄設備有問題代碼43 瀏覽:921
怎麼他么怎麼又網路了 瀏覽:649
java會出現內存泄露么 瀏覽:617
蘋果4s鎖屏後怎麼還顯示歌曲 瀏覽:207
鴻蒙系統文件管理哪些可以刪除 瀏覽:550
ubuntuqt創建工程沒有配置文件 瀏覽:126
網站登錄變成其他網站怎麼處理 瀏覽:202
ug數控編程學校有哪些 瀏覽:203
java圖片上傳顯示 瀏覽:402
ppt的文件名後綴 瀏覽:902
ug編程軟體下載到哪個盤 瀏覽:359
炫酷字體APP下載的文件在哪裡 瀏覽:668
廊坊哪裡有少兒編程機構 瀏覽:312

友情鏈接