c - 重新安装工具链后出现大量“多重定义”
问题描述
我正在开发开源 ARDF 发射器(https://github.com/WhiteFossa/yiff-l),目前正在开发固件。
在固件中(使用 Eclipse Embedded CDT 用 C 语言为 STM32F103 编写)我有很多 .h 文件,它们都包含在 main.h 中,然后 main.h 包含在所有 .c 文件中。
这种方法效果很好,我的代码是可编译的等等。
然后由于某种原因我不得不重新安装我的 Fedora,当然,还要重新安装工具链、Eclipse 等。
现在我收到大量(准确地说是 1087)错误消息,如下所示:
(.text+0x0): multiple definition of `L2HAL_SSD1327_Context'; ./src/l2hal/src/l2hal.o (symbol from plugin):(.text+0x0): first defined here
/home/fossa/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/10.2.1-1.1.2/.content/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: ./src/stm32f1xx_it.o (symbol from plugin): in function `NMI_Handler':
(.text+0x0): multiple definition of `I2C_Other'; ./src/l2hal/src/l2hal.o (symbol from plugin):(.text+0x0): first defined here
/home/fossa/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/10.2.1-1.1.2/.content/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: ./src/stm32f1xx_it.o (symbol from plugin): in function `NMI_Handler':
(.text+0x0): multiple definition of `I2C_Display'; ./src/l2hal/src/l2hal.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:87: Yiff-HL.elf] Error 1
"make -j all" terminated with exit code 2. Build might be incomplete.
14:31:50 Build Failed. 1087 errors, 4 warnings. (took 1s.30ms)
有人可以帮我解决这个问题吗?
代码(以及我的包含方式)有问题吗?或者,也许是编译器/链接器设置有问题?
提前致谢。
解决方案
推荐阅读
- openshift - React 脚本未在开发环境中运行 -Openshift
- react-native - 无法打开反应原生项目
- javascript - React / React-native - 获取自定义组件的子组件
- react-native - 捆绑失败:错误:无法从 `src\IntroScreen\IntroScreen.js` 解析模块 `../../assets/images/background.png`
- javascript - 带有 id 的声明元素并在同一个 JSX 中访问它
- php - 如何限制通过TYPO3 Tca文件上传字段上传的文件类型?
- jquery - 数据表嵌套表应采用正确格式
- r - 在环境中调用变量
- javascript - 如果没有提供 url,则取消设置 img src vue.js
- selenium - 即使从 selenium WebDriver 的下拉列表中验证了元素也没有被点击