Undefined reference to `qBadAlloc()' all over the place
-
Hi all.
I made an application at home, compiled it, and works nicely. Now it's in a server. When I run make I get a lot of @undefined reference to `qBadAlloc()'@, from different files and fuctions... using xubuntu, just installed qt using apt-get, and well, it just doesn't compile. qmake runs fine. This is the output of make. What library am I missing? what didn't I install? have no idea...
bq. jbcolme@mybox:~/dg/dg0.2$ make
g++ -Wl,-O1 -o bin/dg0 main.o newProject.o seg2build.o velocity.o plot.o invertDialog.o blockWindow.o splines.o moc_newProject.o moc_velocity.o moc_plot.o moc_invertDialog.o moc_blockWindow.o -L/usr/lib -L/usr/local/qwt-5.2.0/lib/ -lqwt -lQtGui -lQtCore -lpthread
newProject.o: In functionQVector<QString>::realloc(int, int)': /opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:468: undefined reference to
qBadAlloc()'
/opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:478: undefined reference toQVectorData::reallocate(QVectorData*, int, int, int)' /opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:479: undefined reference to
qBadAlloc()'
newProject.o: In functionQVectorTypedData<QString>::free(QVectorTypedData<QString>*, int)': /opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:96: undefined reference to
QVectorData::free(QVectorData*, int)'
newProject.o: In functionQVector<QString>::malloc(int)': /opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:391: undefined reference to
QVectorData::allocate(int, int)'
/opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:392: undefined reference toqBadAlloc()' velocity.o: In function
QList<QString>::detach_helper()':
velocity.cpp:(.text._ZN5QListI7QStringE13detach_helperEv[QList<QString>::detach_helper()]+0x1d): undefined reference toQListData::detach3()' velocity.o: In function
QVector<double>::realloc(int, int)':
velocity.cpp:(.text._ZN7QVectorIdE7reallocEii[QVector<double>::realloc(int, int)]+0x82): undefined reference toqBadAlloc()' velocity.cpp:(.text._ZN7QVectorIdE7reallocEii[QVector<double>::realloc(int, int)]+0x13d): undefined reference to
QVectorData::reallocate(QVectorData*, int, int, int)'
velocity.cpp:(.text._ZN7QVectorIdE7reallocEii[QVector<double>::realloc(int, int)]+0x14b): undefined reference toqBadAlloc()' velocity.o: In function
QVector<double>::malloc(int)':
velocity.cpp:(.text._ZN7QVectorIdE6mallocEi[QVector<double>::malloc(int)]+0x35): undefined reference toQVectorData::allocate(int, int)' velocity.cpp:(.text._ZN7QVectorIdE6mallocEi[QVector<double>::malloc(int)]+0x43): undefined reference to
qBadAlloc()'
velocity.o: In functionQVectorTypedData<double>::free(QVectorTypedData<double>*, int)': velocity.cpp:(.text._ZN16QVectorTypedDataIdE4freeEPS0_i[QVectorTypedData<double>::free(QVectorTypedData<double>*, int)]+0x14): undefined reference to
QVectorData::free(QVectorData*, int)'
plot.o: In functionQVector<QPointF>::malloc(int)': plot.cpp:(.text._ZN7QVectorI7QPointFE6mallocEi[QVector<QPointF>::malloc(int)]+0x35): undefined reference to
QVectorData::allocate(int, int)'
plot.cpp:(.text._ZN7QVectorI7QPointFE6mallocEi[QVector<QPointF>::malloc(int)]+0x43): undefined reference toqBadAlloc()' plot.o: In function
QVectorTypedData<QPointF>::free(QVectorTypedData<QPointF>, int)':
plot.cpp:(.text._ZN16QVectorTypedDataI7QPointFE4freeEPS1_i[QVectorTypedData<QPointF>::free(QVectorTypedData<QPointF>, int)]+0x14): undefined reference toQVectorData::free(QVectorData*, int)' plot.o: In function
QVector<QPointF>::realloc(int, int)':
plot.cpp:(.text._ZN7QVectorI7QPointFE7reallocEii[QVector<QPointF>::realloc(int, int)]+0x11a): undefined reference toqBadAlloc()' plot.cpp:(.text._ZN7QVectorI7QPointFE7reallocEii[QVector<QPointF>::realloc(int, int)]+0x18a): undefined reference to
QVectorData::reallocate(QVectorData*, int, int, int)'
plot.cpp:(.text._ZN7QVectorI7QPointFE7reallocEii[QVector<QPointF>::realloc(int, int)]+0x198): undefined reference to `qBadAlloc()'
collect2: ld returned 1 exit status
make: *** [bin/dg0] Error 1 -
bq. qmake distclean
Just for the reference - that should be "make distclean"
You compiled your application against a Qt version that was built with exception support, but then try to partially link it again against a Qt version without exception support.
When you switch Qt versions like that, you should always run "make clean" to do a clean build.