[作業] compiler system("./c-- test1.s") 出問題

看板b93902HW作者 (gomibako)時間18年前 (2007/06/11 23:45), 編輯推噓3(302)
留言5則, 4人參與, 最新討論串1/2 (看更多)
請問一下,有沒有人也有遇到類似的情況 就是我在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

06/12 00:04, , 1F
你沒寫main function嗎?
06/12 00:04, 1F

06/12 01:24, , 2F
用execl?
06/12 01:24, 2F

06/12 02:30, , 3F
有fclose嗎? 我好像也遇過 那個error是說檔案裡沒有main()
06/12 02:30, 3F

06/12 08:01, , 4F
太神奇了!把檔案fclose就ok了...為什麼呀?
06/12 08:01, 4F

06/12 08:02, , 5F
非常感謝學長!!
06/12 08:02, 5F
文章代碼(AID): #16RMuJNL (b93902HW)
文章代碼(AID): #16RMuJNL (b93902HW)