【发布时间】:2016-02-29 08:00:28
【问题描述】:
我在带有 MingW 编译器的 Windows 10 64 位上使用 Qt 5.5。
我正在尝试在调试模式下编译我的项目 => 完美运行
但是在发布模式下,我有这些错误:
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 和重新构建,但仍然有错误。
我使用了一些 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
}
如何解决这个问题?
谢谢
【问题讨论】:
-
你比较过链接命令行吗?如果这在一种配置中有效,但在另一种配置中无效(调试与发布),则它们之间必须存在一些差异。
-
我添加了 .pro 文件,我还没有比较命令行。我稍后再做。