0
我試着在我的c源代碼上使用make並創建可執行文件。但可執行文件不能用於預期的任務。即使make文件編譯,生成的可執行文件,當我嘗試編譯.c文件單獨它給了很多不確定的參考問題 的錯誤是如何在Linux中使用「make和building executables」工作
/tmp/cc4tx0BG.o: In function `main':
cubist.c:(.text+0xdc): undefined reference to `Of'
cubist.c:(.text+0xe7): undefined reference to `Of'
cubist.c:(.text+0xfa): undefined reference to `Of'
cubist.c:(.text+0x10f): undefined reference to `KRInit'
cubist.c:(.text+0x114): undefined reference to `ExecTime'
cubist.c:(.text+0x127): undefined reference to `PrintHeader'
cubist.c:(.text+0x139): undefined reference to `Of'
[...]
cubist.c:(.text+0xb79): undefined reference to `MaxAtt'
cubist.c:(.text+0xb83): undefined reference to `InitialiseEnvData'
cubist.c:(.text+0xb8a): undefined reference to `XVAL'
cubist.c:(.text+0xb93): undefined reference to `CrossVal'
cubist.c:(.text+0xb9a): undefined reference to `SingleCttee'
cubist.c:(.text+0xb9f): undefined reference to `ExecTime'
cubist.c:(.text+0xbab): undefined reference to `Of'
collect2: error: ld returned 1 exit status
請,可以在任何身體告訴用就怎麼做和建築Linux中的可執行文件。
減少輸出,從第10行開始會發生什麼情況是可以理解的。 – 0andriy
我認爲這是一個鏈接錯誤。你是如何編譯你的源代碼的? – uzsolt
我使用gcc編譯器來獲取名爲cubist的可執行文件。 gcc -o cubist cubist.c – melaku