当将新的cubeMX项目导入到VisualGDB中时,我遇到了一些问题。我得到了大量的错误,比如:undefined reference to 'vPortFree' (例如)
采取的步骤:
使用VS中的其他toolchain"
项目创建后,我尝试构建它,但是我得到了以下错误:
Severity Description Project File Line
Error undefined reference to `vPortFree' stm32nucleof429zi_freertos_tcpip C:\Repos\stm32nucleof429zi_freertos_tcpip.git\stm32nucleof429zi_freertos_tcpip.git\Middlewares\Third_Party\FreeRTOS\Source\tasks.c 3920
Error undefined reference to `vPortFree' stm32nucleof429zi_freertos_tcpip C:\Repos\stm32nucleof429zi_freertos_tcpip.git\stm32nucleof429zi_freertos_tcpip.git\Middlewares\Third_Party\FreeRTOS\Source\tasks.c 3921
Error undefined reference to `vPortFree' stm32nucleof429zi_freertos_tcpip C:\Repos\stm32nucleof429zi_freertos_tcpip.git\stm32nucleof429zi_freertos_tcpip.git\Middlewares\Third_Party\FreeRTOS\Source\tasks.c 3927
Error Build failed: arm-none-eabi-g++.exe exited with code 1 stm32nucleof429zi_freertos_tcpip 1
Error ld returned 1 exit status stm32nucleof429zi_freertos_tcpip C:\Repos\stm32nucleof429zi_freertos_tcpip.git\stm32nucleof429zi_freertos_tcpip.git\collect2.exe 0 但是,当我右键单击main.c并进行编译时,该项目将无错误地编译。当使用构建工具和调试器时,会出现这些错误。
在导入项目时,我从来没有遇到过这个问题。如有任何帮助,将不胜感激
发布于 2022-01-31 15:05:48
在玩了一段时间的配置之后,我发现了问题。CubeMx创建的工具链文件没有告诉链接器包含FreeRTOS编译所需的所有文件。
只有当您正在使用CMSIS_RTOS_V2并且以下步骤为我修复它时,此问题才是相关的:
将CMSIS_RTOS_V2添加到项目空间,方法是: Add缺失包含:
若要解决未确定的引用“pvPortMalloc”错误:
“解决方案资源管理器”窗口中VS中的
并将其包括在heap_4.c中
https://stackoverflow.com/questions/70902539
复制相似问题