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

扶醉桌前 提交于 2021-01-28 00:51:50

问题


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  

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

Yes, I have tried Google before.

The .pro file:

    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


回答1:


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



来源:https://stackoverflow.com/questions/35694482/c-qt-mingw-bad-reloc-0xc-address-in-section-rdata

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!