gpt4 book ai didi

c++ - 无法在 keil c 项目中添加 C++ 库

转载 作者:太空宇宙 更新时间:2023-11-04 04:35:09 27 4
gpt4 key购买 nike

<分区>

我正在尝试向 keil 中的 c 项目添加一个 c++ 库。代码正在正确编译和链接,但我无法调试,因为它没有到达 main。它在函数 sys_open 处停止,正好在 BKPT 0xAB 指令处。我试着在 keil 论坛发帖。

http://www.keil.com/forum/59982/#msg195240

我觉得跟semihosting in arm有关。我尝试不使用半托管,并在 retarget.c 中重新实现了以下功能。但是我收到一个链接器错误,指出 sys_open 被多重定义。

Error: L6200E: Symbol _sys_open multiply defined (by sys_io.o and retarget.o).

我正在删除定义,但出现以下链接器错误。

.\Objects\STM32429I_EVAL.axf: Error: L6915E: Library reports error: __use_no_semihosting was requested, but _sys_open was referenced

我做错了什么??

我添加到项目中的 lib 文件使用了断言函数。如果那是问题所在,我如何在重定向中重新实现断言?

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com