导航:首页 > 文件管理 > 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找不到库文件怎么办相关的资料

热点内容
团购是在哪个app 浏览:897
打开多个word文档图片就不能显示 浏览:855
腾讯新闻怎么切换版本 浏览:269
app安装失败用不了 浏览:326
桌面文件鼠标点开会变大变小 浏览:536
手机误删系统文件开不了机 浏览:883
微信兔子甩耳朵 浏览:998
android蓝牙传文件在哪里 浏览:354
苹果6s软解是真的吗 浏览:310
c语言代码量大 浏览:874
最新网络卫星导航如何使用 浏览:425
以下哪些文件属于图像文件 浏览:774
zycommentjs 浏览:414
确认全血细胞减少看哪些数据 浏览:265
文件有哪些要求 浏览:484
cad打开时会出现两个文件 浏览:65
什么是转基因网站 浏览:48
手柄设备有问题代码43 浏览:921
怎么他么怎么又网络了 浏览:649
java会出现内存泄露么 浏览:617

友情链接