C++ Qt MingW rdata 节中的错误 reloc 0xc 地址 [英] C++ Qt MingW bad reloc 0xc address in section rdata

查看:69
本文介绍了C++ Qt MingW rdata 节中的错误 reloc 0xc 地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm with Qt 5.5 on Windows 10 64 bit with MingW compiler.
I'm trying to compile my project in debug mode => Works perfectly
But in release mode, I have these errors:

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 中).

I have tried to do clean, qmake, and rebuild, but there are still errors.
I use some SFML dlls, and dlls I created. My TileMap class inherits a SFML class, and a micropather class (which is in one of the dlls).

是的,我以前试过谷歌.

.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  
} 

如何解决这个问题?
谢谢

How to resolve this ?
Thanks

推荐答案

我把.cpp文件中函数前的inline删掉了,居然成功了……好奇怪.

I deleted the inline before the function in the .cpp file, and it worked... Such strange.

这篇关于C++ Qt MingW rdata 节中的错误 reloc 0xc 地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆