ubuntu下 llvm-gcc cannot find crti.o: No such file or directory解决办法
2014-01-11 20:19
513 查看
ubuntu下当执行 llvm-gcc hello.c -o hello 命令,若出现
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: ld returned 1 exit status
解决方法如下:
1.在系统中查找crti.o
2.将该路径添加到LIBRARY_PATH
方法一:(仅当前shell生效,关闭shell将失效)
方法二:(永久生效)
$ source ~/.bashrc
3.再次执行,顺利编译
4.查看LIBRARY_PATH
echo $LIBRARY_PATH
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: ld returned 1 exit status
解决方法如下:
1.在系统中查找crti.o
sudo find /usr/ -name crti*
将得到结果:
(32位)/usr/lib/i386-linux-gnu/crti.o
(64位)/usr/lib/x86_64-linux-gnu/crti.o
2.将该路径添加到LIBRARY_PATH
方法一:(仅当前shell生效,关闭shell将失效)
(32位)
LIBRARY_PATH=/usr/lib/i386-linux-gnu:$LIBRARY_PATH export LIBRARY_PATH
(64位)LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH
export LIBRARY_PATH
方法二:(永久生效)
(32位)
$ echo "export LIBRARY_PATH=/usr/lib/i386-linux-gnu" >> ~/.bashrc $ source ~/.bashrc
(64位)$ echo "export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu" >> ~/.bashrc
$ source ~/.bashrc
3.再次执行,顺利编译
4.查看LIBRARY_PATH
echo $LIBRARY_PATH
相关文章推荐
- ubuntu:configure error:cannot find ssl libraries
- ubuntu(NRPE安装):configure error:cannot find ssl libraries
- ubuntu下Qt cannot find -lGL错误的解决方法
- 新建ubuntu虚拟机用其它VirtualBox虚拟硬盘cannot find device eth
- How to find arm-apple-darwin#-llvm-gcc-4.2 compiler on Xcode 5?
- 在ubuntu 14.04系统中安装cuda-7.5时编译samples文件,出现cannot find lnvcuvid 错误
- Ubuntu下,Qt编译报错:cannot find -lGL的解决办法。
- ubuntu tomcat cannot find catalina.sh 解决 转自:http://zhoujinxiong.javaeye.com/blog/574228
- ubuntu下Qt cannot find -lGL错误的解决方法
- 解决Mac OS lion下(ubuntu等linux也一样)启动tomcat的Cannot find ./catalina.sh 的问题
- Ubuntu下PHP动态编译出现Cannot find autoconf的解决方法
- ubuntu tomcat cannot find catalina.sh 解决 转自:http://zhoujinxiong.javaeye.com/blog/574228
- ubuntu 编译 /usr/bin/ld: cannot find 问题解决
- ubuntu 编译 /usr/bin/ld: cannot find 问题解决
- QT in Ubuntu cannot find -lfreetype
- Ubuntu编译链接错误:cannot find -lz解决办法
- 解决Ubuntu 16下编译Qt 5报错:cannot find -lGL
- Ubuntu cannot find the system settings
- 在x86-64位机器上不用gcc直接ld:ld: warning: cannot find entry symbol _start; defaulting to 00000000004002c8
- yacc&lex gcc cannot find -ll