peng-zhihui / Dummy-Robot

我的超迷你机械臂机器人项目。
11.89k stars 2.63k forks source link

STM32 Cube IDE 編譯問題 (undefined reference to) #160

Closed Kevin75311 closed 1 year ago

Kevin75311 commented 1 year ago

我使用 Cube IDE 開啟專案後,編譯時發現無法找到 Userapp/common_inc.h

image

將它加入 compiler include 的 PATH 後,變成 common_inc.h 裡面的 function 無法引用 (undefined reference to)

image

想請問是 C 和 C++ 混編造成的問題嗎? 謝謝!

sytnocui commented 1 year ago

我把main.cpp的名字改成 userapp.c 就好使了

peng-zhihui commented 1 year ago

改CMakeLists.txt,不要改path,正常应该是有这个包含路径的,CLion里面clear cache and restart试一下