gpt4 book ai didi

c++ - 在 `.rodata' 节中引用

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:06:00 24 4
gpt4 key购买 nike

嘿 friend
我陷入严重的链接错误,我收到这样的错误 referenced in section .rodata' of xxx defined in discarded section .text._xxx.

这就是我编译程序的方式

   g++  main.o CPQENReportBB1.o CPQENReportBB2.o CPQ10minRecord.o  PQ10minconfiguration.o  ENReportConfig.o CPQFreeRecording.o CPQFreeHistogramReport.o 

我有 8 个文件,编译正确,但在链接时出现前面提到的错误。
(我使用的是 g++ 3.4.3 版)
在两个文件中,我收到此错误消息;我试图在链接中随机播放文件,但随后在另外两个文件中出现错误。
请提出解决此问题的任何建议。我正在使用 C++ 模板

最佳答案

2 可能的原因:

  1. 文件格式和机器架构。
  2. 使用__attribute__((section))

关于c++ - 在 `.rodata' 节中引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13451160/

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