亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 4317 | 回復(fù): 6
打印 上一主題 下一主題

[Linux] 不能靜態(tài)編譯是怎么回事: [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2013-01-10 13:02 |只看該作者 |倒序?yàn)g覽
[root@localhost gcc]# gcc hello.c -static
/usr/bin/ld: cannot find -lc
collect2: ld 返回 1
[root@localhost gcc]#

就是一個(gè)簡單的helloworld程序,動(dòng)態(tài)編譯是可以的。。。。

這個(gè)問題該怎么解決呢?

我的是RHEL6.3。

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2013-01-10 13:06 |只看該作者
我把這個(gè)錯(cuò)誤也google了一大圈,不過他們遇到的都是動(dòng)態(tài)編譯的問題,沒有辦法和他們一樣,我該怎么辦呢?

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2013-01-10 13:16 |只看該作者
靜態(tài)編譯過程:
  1. [root@localhost gcc]# gcc hello.c -static -v
  2. 使用內(nèi)建 specs。                           
  3. 目標(biāo):i686-redhat-linux                     
  4. 配置為:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux            
  5. 線程模型:posix                                                                                                                           
  6. gcc 版本 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)                                                                                            
  7. COLLECT_GCC_OPTIONS='-static' '-v' '-mtune=generic' '-march=i686'                                                                          
  8. /usr/libexec/gcc/i686-redhat-linux/4.4.6/cc1 -quiet -v hello.c -quiet -dumpbase hello.c -mtune=generic -march=i686 -auxbase hello -version -o /tmp/ccgvUlfr.s                                                                                                                        
  9. 忽略不存在的目錄“/usr/lib/gcc/i686-redhat-linux/4.4.6/include-fixed”                                                                       
  10. 忽略不存在的目錄“/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../../i686-redhat-linux/include”                                               
  11. #include "..." 搜索從這里開始:                                                                                                            
  12. #include <...> 搜索從這里開始:                                                                                                            
  13. /usr/local/include                                                                                                                        
  14. /usr/lib/gcc/i686-redhat-linux/4.4.6/include                                                                                             
  15. /usr/include                                                                                                                              
  16. 搜索列表結(jié)束。                                                                                                                             
  17. GNU C (GCC) 版本 4.4.6 20120305 (Red Hat 4.4.6-4) (i686-redhat-linux)                                                                     
  18.         由 GNU C 版本 4.4.6 20120305 (Red Hat 4.4.6-4) 編譯,GMP 版本 4.3.1,MPFR 版本 2.4.1。                                             
  19. GGC 準(zhǔn)則:--param ggc-min-expand=98 --param ggc-min-heapsize=128840                                                                        
  20. Compiler executable checksum: 506e10f785e7685b65c06e4e4f09a704                                                                             
  21. COLLECT_GCC_OPTIONS='-static' '-v' '-mtune=generic' '-march=i686'                                                                          
  22. as -V -Qy -o /tmp/ccOkF991.o /tmp/ccgvUlfr.s                                                                                             
  23. GNU assembler version 2.20.51.0.2 (i686-redhat-linux) using BFD version version 2.20.51.0.2-5.34.el6 20100205                              
  24. COMPILER_PATH=/usr/libexec/gcc/i686-redhat-linux/4.4.6/:/usr/libexec/gcc/i686-redhat-linux/4.4.6/:/usr/libexec/gcc/i686-redhat-linux/:/usr/lib/gcc/i686-redhat-linux/4.4.6/:/usr/lib/gcc/i686-redhat-linux/:/usr/libexec/gcc/i686-redhat-linux/4.4.6/:/usr/libexec/gcc/i686-redhat-linux/:/usr/lib/gcc/i686-redhat-linux/4.4.6/:/usr/lib/gcc/i686-redhat-linux/
  25. LIBRARY_PATH=/usr/lib/gcc/i686-redhat-linux/4.4.6/:/usr/lib/gcc/i686-redhat-linux/4.4.6/:/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../:/lib/:/usr/lib/
  26. COLLECT_GCC_OPTIONS='-static' '-v' '-mtune=generic' '-march=i686'
  27. /usr/libexec/gcc/i686-redhat-linux/4.4.6/collect2 --build-id -m elf_i386 --hash-style=gnu -static /usr/lib/gcc/i686-redhat-linux/4.4.6/../../../crt1.o /usr/lib/gcc/i686-redhat-linux/4.4.6/../../../crti.o /usr/lib/gcc/i686-redhat-linux/4.4.6/crtbeginT.o -L/usr/lib/gcc/i686-redhat-linux/4.4.6 -L/usr/lib/gcc/i686-redhat-linux/4.4.6 -L/usr/lib/gcc/i686-redhat-linux/4.4.6/../../.. /tmp/ccOkF991.o --start-group -lgcc -lgcc_eh -lc --end-group /usr/lib/gcc/i686-redhat-linux/4.4.6/crtend.o /usr/lib/gcc/i686-redhat-linux/4.4.6/../../../crtn.o
  28. /usr/bin/ld: cannot find -lc
  29. collect2: ld 返回 1
  30. [root@localhost gcc]#
復(fù)制代碼

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2013-01-10 13:17 |只看該作者
hello.c
  1. #include<stdio.h>
  2. int main()
  3. {
  4.   printf("Hello World!\n");
  5. }
復(fù)制代碼

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2013-01-10 13:35 |只看該作者
解決了,我在RHEL5上是可以靜態(tài)鏈接的,就鎖定的是缺少libc.a,就在RHEL5上 locate 一下,找到了,就拷貝過來 ,就好了。

論壇徽章:
95
程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-05 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-17 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-09-18 06:20:002015亞冠之阿爾艾因
日期:2015-09-18 10:35:08月度論壇發(fā)貼之星
日期:2015-09-30 22:25:002015亞冠之阿爾沙巴布
日期:2015-10-03 08:57:39程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-10-05 06:20:00每日論壇發(fā)貼之星
日期:2015-10-05 06:20:002015年亞冠紀(jì)念徽章
日期:2015-10-06 10:06:482015亞冠之塔什干棉農(nóng)
日期:2015-10-19 19:43:35程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-10-21 06:20:00每日論壇發(fā)貼之星
日期:2015-09-14 06:20:00
6 [報(bào)告]
發(fā)表于 2013-01-10 17:21 |只看該作者
kangear 發(fā)表于 2013-01-10 13:35
解決了,我在RHEL5上是可以靜態(tài)鏈接的,就鎖定的是缺少libc.a,就在RHEL5上 locate 一下,找到了,就拷貝過 ...


你應(yīng)該在 RHEL6.3 上把 glibc-static 安裝上

論壇徽章:
0
7 [報(bào)告]
發(fā)表于 2013-01-10 19:46 |只看該作者
好像沒有這個(gè)包呀?
這是光盤中的:
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP