簡體   English   中英

Eclipse CDT-錯誤:“對n的未定義引用”?

[英]Eclipse CDT - errors: “undefined reference to n”?

我不確定這是否屬於此處或在electronics.stackexchange.com上,但是由於這與IDE設置和編譯有關,因此我相信這是問我問題的最佳位置。

我在Eclipse CDT中設置了C項目。 它使用Mentor Graphics的Sourcery CodeBench Lite ARM工具鏈。 我已經安裝了Eclipse CDT,並安裝了GNU ARM Eclipse插件,並嘗試設置ST.com STM32F4 Discovery示例以在Eclipse CDT中進行編譯。

編譯時,編譯器將輸出200多個錯誤(為簡潔起見,已縮短):

.../main.c:75: undefined reference to `STM_EVAL_PBInit'
.../main.c:77: undefined reference to `STM_EVAL_LEDInit'
.../main.c:78: undefined reference to `STM_EVAL_LEDInit'
.../main.c:79: undefined reference to `STM_EVAL_LEDInit'
.../main.c:80: undefined reference to `STM_EVAL_LEDInit'
.../main.c:83: undefined reference to `RCC_GetClocksFreq'
.../main.c:86: undefined reference to `STM_EVAL_PBGetState'
.../main.c:89: undefined reference to `STM_EVAL_LEDOn'
.../main.c:90: undefined reference to `STM_EVAL_LEDOn'
.../main.c:91: undefined reference to `STM_EVAL_LEDOn'
.../main.c:92: undefined reference to `STM_EVAL_LEDOn'

幾乎所有這些項目都在stm32f4_discovery.h中定義,但是由於某些原因,它們在編譯期間沒有得到解決。

我已經檢查並再次檢查了文件是否可用C / C ++常規>路徑和符號,包括選項卡,但是不確定為什么事情沒有解決。

在此處輸入圖片說明

該項目可在GitHub上使用 ,適用於想要結帳並自己嘗試編譯的任何人。

我也在Github上創建了一個票證 ,因為我不想在這里充斥輸出信息。

只需將https://github.com/josefvanniekerk/stm32f4-discovery.git克隆,將stm32f4-discovery / projects / demonstration導入Eclipse CDT,然后嘗試編譯。

Sourcery CodeBench Lite工具鏈是在Mac OS X上從arm-cs-tools-build.sh編譯的 ,並且需要Eclipse GNU ARM插件 ,可以使用其更新站點將其安裝到Eclipse中。

原來我只需要在下面添加外部源

C / C ++常規>路徑和符號>源位置

仍然存在一些錯誤,但不再與此問題相關。 :)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM