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
I deleted the inline before the function in the .cpp file, and it worked... Such strange.
Related
I have installed LibRaw-0.20.1.zip from https://www.libraw.org/download.
I compile it, and produce libraw.lib and libraw.dll. It is 32 bit.
I then use it in qt:
win32: LIBS += -L$$PWD/../../LibRaw-0.20.0/lib/ -llibraw
INCLUDEPATH += $$PWD/../../LibRaw-0.20.0
DEPENDPATH += $$PWD/../../LibRaw-0.20.0
This path is right, but I get this is error:
C:\QtProject\UDP\mainwindow.cpp:359: error: undefined reference to `LibRaw::LibRaw(unsigned int)'
I have got an issue while integrating opencv 3.1 with Qt 5.6.
the project .pro file contains
INCLUDEPATH += C:/opencv/build/include
LIBS += -LC:/opencv/build/x64/vc14/lib
INCLUDEPATH += LIBS += -lopencv_world310
but gives undefined reference errors like:
error: undefined reference to `cv::VideoCapture::VideoCapture()
I have even tried using cmake, but it still gives the same error.
Thanks in advance for your help.
/usr/lib/libpoppler.so.50: undefined reference to std::__throw_out_of_range_fmt(char const*, ...)#GLIBCXX_3.4.20'
Makefile:156: recipe for target 'DocViewer' failed
/usr/lib/libsystemd.so.0: undefined reference tolzma_stream_decoder#XZ_5.0'
/usr/lib/libQt5Core.so: undefined reference to __cxa_throw_bad_array_new_length#CXXABI_1.3.8'
/usr/lib/libsystemd.so.0: undefined reference tolzma_end#XZ_5.0'
/usr/lib/libsystemd.so.0: undefined reference to `lzma_code#XZ_5.0'
collect2: error: ld returned 1 exit status
make: *** [DocViewer] Error 1
20:53:35: The process "/usr/bin/make" exited with code 2.
I get the errors mentioned above while compiling a program using poppler in Qt5.
Below is my project file, should in change something?
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = DocViewer
TEMPLATE = app
INCLUDEPATH += /usr/include/poppler/qt5
LIBS += -L/usr/lib -lpoppler-qt5
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
For the "__cxa_throw_bad_array_new_length#CXXABI_1.3.8" error in libicu, it looks like the problem is an incompatible icu build (softfp vs hardfp).
I had the same error, which I solved by downloading a rebuilt ICU (to avoid rebuilding it myself).
Download the "POT" binaries from
http://thebugfreeblog.blogspot.fr/2016/12/binaries-for-pot-550-beta1-on-qt-580.html.
lrzuntar the file
tar xf qtdeps.tar
on the device, move away libicu* (in my case with raspbian it was in usr/lib/arm-linux-gnueabihf), and transfer the libicu* from qtdeps over there
on the device, move away the "unicode" include dir (with raspbian it was in /usr/include/arm-linux-gnueabihf/unicode), and copy the unicode include dir from qtdeps over there.
re-sync from the device to your sysroot using rsync
reconfigure and rebuilt qtbase (after removing the .o files under qtbase/src/corelib that contain "icu" in the name - or rebuild Qt from scratch)
I try to compile one of my project I made with windows 7 64 bits using Qt5.3.1 MSVC2012, by using now Qt5.4 gcc 64 bits with Unbuntu 14.04 LTS.
But I have some "undefined reference to" errors :
/home/innocore/Software/CES_2015/trunk/MainProgram/../bin//libSmartphoneController.a(smartphonecontroller.o): In function SmartphoneController::init()':
/home/innocore/Software/CES_2015/trunk/bin/../LibSmartphoneController/smartphonecontroller.cpp:11: undefined reference toRemoteADBInterface::RemoteADBInterface(QString, QString, int, QObject*)'
/home/innocore/Software/CES_2015/trunk/bin/../LibSmartphoneController/smartphonecontroller.cpp:13: undefined reference to RemoteADBInterface::newMessage(RemoteADBInterface::Message const&, QVariant const&)'
/home/innocore/Software/CES_2015/trunk/MainProgram/../bin//libSmartphoneController.a(smartphonecontroller.o): In functionQMetaObject::Connection QObject::connect(QtPrivate::FunctionPointer::Object const*, void (RemoteADBInterface::)(RemoteADBInterface::Message const&, QVariant const&), QtPrivate::FunctionPointer::Object const, void (SmartphoneController::*)(RemoteADBInterface::Message const&, QVariant const&), Qt::ConnectionType)':
/opt/5.4/gcc_64/include/QtCore/qobject.h:239: undefined reference to `RemoteADBInterface::staticMetaObject'
collect2: error: ld returned 1 exit status
my project is composed of one exe and several libraries like libSmartphoneController.a or libRemoteADB.a.
All the libraries compile correctly and are created in the right directory. The problem occurs when I compile my exe program (MainProgram).
In the .pro, I'm sure I include the right dependencies :
unix:!macx {
CONFIG(release, release|debug) {
LIBS += -L$$PWD/../Lib/ -lAudioPlayer -lDisplay -lSWCom -lRemoteADB -lDMS -lTVRemote \
-lHDMIMixer -lSmartphoneController -lRemoteServer
}
CONFIG(debug, release|debug) {
LIBS += -L$$PWD/../bin/ -lAudioPlayer -lDisplay -lSWCom -lRemoteADB -lDMS -lTVRemote \
-lHDMIMixer -lSmartphoneController -lRemoteServer
} }
The lib SmartphoneController also have two dependencies :
in SmartphoneController.pro :
unix:!macx {
CONFIG(release, release|debug) {
LIBS += -L$$PWD/../Lib/ -lRemoteADB -lRemoteServer
}
CONFIG(debug, release|debug) {
LIBS += -L$$PWD/../bin/ -lRemoteADB -lRemoteServer
} }
The problem is that it does not find the definition of some function in the lib RemoteADB (contructor, signal readMessage...). I don't have any problem with all other libs + it compiles perfectly on windows...
Any idea ?
Thanks in advance for your help
I see a possible cause for your problem: the compiler does not find the library file and you can solve this by adding in the .pro file the full path where you have saved the libraries, what I can see here is that you have different path where to search libraries if are compiling debug or release, are you sure you have the correct libraries in both places ?
This would be an example of what to put in your pro file:
LIBS += -L$$OUT_PWD/../../../projects/mylibs/release/
I'm trying to run the CCV library linked at http://libccv.org/ in QT Creator on Ubuntu 14. I followed this tutorial http://libccv.org/tutorial/ and I'm trying now to run the first simple example. I get these errors:
error: undefined reference to ccv_read_impl(void const*, ccv_dense_matrix_t**, int, int, int, int)
error: undefined reference to ccv_write(ccv_dense_matrix_t*, char*, int*, int, void*)
This is the .pro file of the project:
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
unix:!macx: LIBS += -L$$PWD/../../../CNN/ccv/lib/ -lccv
INCLUDEPATH += $$PWD/../../../CNN/ccv/lib
DEPENDPATH += $$PWD/../../../CNN/ccv/lib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../CNN/ccv/lib/libccv.a
Finally this is the command generated by QT in the compile output:
g++ -m64 -o ccv1 main.o -L/home/fabri/QT/CCV1/ccv1/../../../CNN/ccv/lib/ -lccv
I suppose it's a compiler problem but I don't know what. Thank you.
Modify the example and try to include it like this:
extern "C" {
#include "ccv.h"
}