作者gomibako (gomibako)
看板b93902HW
標題[作業] compiler system("./c-- test1.s") 出問題
時間Mon Jun 11 23:45:22 2007
請問一下,有沒有人也有遇到類似的情況
就是我在code裡面寫
system("./c-- test1.s");
的時候,遇到下面的message
/usr/lib/gcc/x86_64-linux-gnu/4.1.3/../../../../lib/crt1.o: In function
`_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
但是如果我在command line下打 ./c-- test1.s 就很正常
請問是哪裡出問題了呢?
我是在linux3上用的
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.192.225.48
→ sophialiege:你沒寫main function嗎? 06/12 00:04
推 usoko:用execl? 06/12 01:24
推 abchu:有fclose嗎? 我好像也遇過 那個error是說檔案裡沒有main() 06/12 02:30
推 gomibako:太神奇了!把檔案fclose就ok了...為什麼呀? 06/12 08:01
→ gomibako:非常感謝學長!! 06/12 08:02