我在 Windows 10 64 位上使用 Qt 5.5,并使用 MingW 编译器。
我正在尝试在 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 类和微路径类(位于其中一个 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 错误重新定位 0xc 地址在 rdata 节中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35694482/