gpt4 book ai didi

C++ Qt MingW bad reloc 0xc address in section rdata

转载 作者:可可西里 更新时间:2023-11-01 10:04:43 24 4
gpt4 key购买 nike

我在带有 MingW 编译器的 Windows 10 64 位上使用 Qt 5.5。
我正在尝试在 Debug模式下编译我的项目 => 完美运行
但是在 Release模式下,我有这些错误:

undefined reference to `TileMap::XYToNode(int, int) const'
undefined reference to `TileMap::XYToNode(int, int) const'
./release\perso.o: bad reloc address 0xc in section `.rdata'
collect2.exe:-1: erreur : error: ld returned 1 exit status

我尝试过clean、qmake、rebuild,但是还是有错误。
我使用一些 SFML dll 和我创建的 dll。我的 TileMap 类继承了一个 SFML 类和一个 micropather 类(在其中一个 dll 中)。

是的,我以前尝试过 Google。

.pro 文件:

    TEMPLATE = app  
TARGET = TealDemo
QT = widgets

SOURCES += ........

LIBS += -LC:/Qt/5.5/SFML/lib -LC:/Qt/5.5/micropather/lib -LC:/Qt/5.5/pathstore/lib

CONFIG(release): LIBS += -lsfml-graphics -lsfml-main -lsfml-window -lsfml-system -lmp -lpathstore
CONFIG(debug): LIBS += -lsfml-graphics-d -lsfml-main-d -lsfml-window-d -lsfml-system-d -lmpd -lpathstored

INCLUDEPATH += C:/Qt/5.5/SFML/include C:/Qt/5.5/micropather/include C:/Qt/5.5/pathstore/include
DEPENDPATH += C:/Qt/5.5/SFML/include C:/Qt/5.5/micropather/include C:/Qt/5.5/pathstore/include

HEADERS += .......

CONFIG += C++11 warn_on

debug {
DEFINES += TEAL_DEBUG
}

如何解决?
谢谢

最佳答案

我删除了 .cpp 文件中函数之前的内联,它起作用了......真奇怪。

关于C++ Qt MingW bad reloc 0xc address in section rdata,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35694482/

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