對Xil Out32未定義的引用

2021-08-28 14:13:26 字數 880 閱讀 2620

第一次在hls中遇見乙個官方庫函式未定義問題,這就把解決方法記錄下來。

在建立好工程,寫完工程**後,發現報錯如下

./src/led_controller_test_tut_4a.o:在函式『main』中:

/home/greedyhao/projects/learningandworking/led_controller/led_controller.sdk/led_controller_test/debug/../src/led_controller_test_tut_4a.c:44:對『xil_out32』未定義的引用

collect2: error: ld returned 1 exit status

makefile:39: recipe for target 'led_controller_test.elf' failed

make: *** [led_controller_test.elf] error 1

一眼就知道xil_out32這個函式,絕對是官方定義的啊。

找到它的定義在xil_io.h這個檔案中

static inline void xil_out32(uintptr addr, u32 value)

在網上查到有人說,因為這個函式是static的,所以將這個標頭檔案include到主函式的檔案就可以了

於是在主函式檔案新增#include "xil_io.h"並儲存好,工程正常

對pthread create未定義的引用

已經在c檔案中包含了執行緒的標頭檔案,可是編譯的時候卻報錯 對pthread create未定義的引用 原來時因為 pthread庫不是linux系統預設的庫,連線時需要使用庫libpthread.a,所以在使用pthread create建立執行緒時,在編譯中要加 lpthread引數 gcc c...

對 shm open 未定義的引用

編譯出錯 對 shm open 未定義的引用 原因 一般出錯的原因是沒有鏈結庫導致的 解決方法 在編譯最後新增 lrt 例如 gcc o test test.c lrt man shm open的幫助檔案的最後幾行 notes these functions are provided in glib...

對 pthread create 未定義的引用

注 本文由博主同步發布於 對 pthread create 未定義的引用 使用clion,在linux下編寫c 多執行緒程式 使用future和async cmake構建專案失敗,錯誤提示為 對 pthread create 未定義的引用 include include void th1 在函式 s...