在編譯NIOS時出現下圖的錯誤訊息,但是在Hello_led專案內的hello_world.c有main()函數。

我試了一下,發現應該是hello_world.c沒有加到Makefile內去一起生成。

[NIOS][Eclipse] undefined reference to `main' 錯誤

 

 

解決方法是在hello_world.c上按右鍵,點選 [ Add to Nios Build ] 後,則hello_world.c前面會加上一個綠點,就表示加入專案成功,在執行一次Build就可以成功編譯了。

[NIOS][Eclipse] undefined reference to `main' 錯誤

 

 [NIOS][Eclipse] undefined reference to `main' 錯誤

 編譯成功

 

[NIOS][Eclipse] undefined reference to `main' 錯誤

 

相关文章: