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

  免費注冊 查看新帖 |

Chinaunix

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

為什么編譯連接不成功?!! [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2005-06-15 10:24 |只看該作者 |倒序瀏覽
環(huán)境 : REDHAT 7.2下
編譯連接失敗了!
信息如下:

[test@xOS test]$ cat t.c
#include "stdio.h"

FILE *stream, *stream2;

int main( void )
{
   int numclosed;

   /* Open for read (will fail if file "data" does not exist) */
   if( (stream  = fopen( "data", "r" )) == NULL )
      printf( "The file 'data' was not opened\n" );
   else
      printf( "The file 'data' was opened\n" );

   /* Open for write */
   if( (stream2 = fopen( "data2", "w+" )) == NULL )
      printf( "The file 'data2' was not opened\n" );
   else
      printf( "The file 'data2' was opened\n" );

   /* Close stream */
   if( fclose( stream ) )
      printf( "The file 'data' was not closed\n" );

   /* All other files are closed: */
   numclosed = _fcloseall( );
   printf( "Number of files closed by _fcloseall: %u\n", numclosed );
}

[test@xOS test]$ gcc t.c
/tmp/ccfuoEhc.o: In function `main':
/tmp/ccfuoEhc.o(.text+0x15): undefined reference to `__fopen'
/tmp/ccfuoEhc.o(.text+0x5f): undefined reference to `__fopen'
/tmp/ccfuoEhc.o(.text+0xc0): undefined reference to `_fcloseall'
collect2: ld returned 1 exit status
[test@xOS test]$

論壇徽章:
0
2 [報告]
發(fā)表于 2005-06-15 11:14 |只看該作者

為什么編譯連接不成功?!!

檢查程序
把函數(shù)前的下劃線去掉

論壇徽章:
5
IT運維版塊每日發(fā)帖之星
日期:2015-08-06 06:20:00IT運維版塊每日發(fā)帖之星
日期:2015-08-10 06:20:00IT運維版塊每日發(fā)帖之星
日期:2015-08-23 06:20:00IT運維版塊每日發(fā)帖之星
日期:2015-08-24 06:20:00IT運維版塊每日發(fā)帖之星
日期:2015-11-12 06:20:00
3 [報告]
發(fā)表于 2005-06-15 14:54 |只看該作者

為什么編譯連接不成功?!!

哥哥,是不是有個庫沒有include.

論壇徽章:
0
4 [報告]
發(fā)表于 2005-06-16 15:13 |只看該作者

為什么編譯連接不成功?。

哪位大哥試一試,看如何才能編譯、連接通過??
我用下面方法還是錯誤!


[root@xOS root]# gcc t.c -lc                                      
/tmp/ccKiFn0B.o: In function `main':                              
/tmp/ccKiFn0B.o(.text+0x15): undefined reference to `__fopen'     
/tmp/ccKiFn0B.o(.text+0x5f): undefined reference to `__fopen'     
collect2: ld returned 1 exit status                              
[root@xOS root]# gcc t.c -L/usr/lib -lc                           
/tmp/ccIsRPCv.o: In function `main':                              
/tmp/ccIsRPCv.o(.text+0x15): undefined reference to `__fopen'     
/tmp/ccIsRPCv.o(.text+0x5f): undefined reference to `__fopen'     
collect2: ld returned 1 exit status                              

郁悶拉
您需要登錄后才可以回帖 登錄 | 注冊

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

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP