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 function QVector<QString>::realloc(int, int)': /opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:468: undefined reference toqBadAlloc()'
    /opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:478: undefined reference to QVectorData::reallocate(QVectorData*, int, int, int)' /opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:479: undefined reference toqBadAlloc()'
    newProject.o: In function QVectorTypedData<QString>::free(QVectorTypedData<QString>*, int)': /opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:96: undefined reference toQVectorData::free(QVectorData*, int)'
    newProject.o: In function QVector<QString>::malloc(int)': /opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:391: undefined reference toQVectorData::allocate(int, int)'
    /opt/qtsdk-2009.05/qt/include/QtCore/qvector.h:392: undefined reference to qBadAlloc()' velocity.o: In functionQList<QString>::detach_helper()':
    velocity.cpp:(.text._ZN5QListI7QStringE13detach_helperEv[QList<QString>::detach_helper()]+0x1d): undefined reference to QListData::detach3()' velocity.o: In functionQVector<double>::realloc(int, int)':
    velocity.cpp:(.text._ZN7QVectorIdE7reallocEii[QVector<double>::realloc(int, int)]+0x82): undefined reference to qBadAlloc()' velocity.cpp:(.text._ZN7QVectorIdE7reallocEii[QVector<double>::realloc(int, int)]+0x13d): undefined reference toQVectorData::reallocate(QVectorData*, int, int, int)'
    velocity.cpp:(.text._ZN7QVectorIdE7reallocEii[QVector<double>::realloc(int, int)]+0x14b): undefined reference to qBadAlloc()' velocity.o: In functionQVector<double>::malloc(int)':
    velocity.cpp:(.text._ZN7QVectorIdE6mallocEi[QVector<double>::malloc(int)]+0x35): undefined reference to QVectorData::allocate(int, int)' velocity.cpp:(.text._ZN7QVectorIdE6mallocEi[QVector<double>::malloc(int)]+0x43): undefined reference toqBadAlloc()'
    velocity.o: In function QVectorTypedData<double>::free(QVectorTypedData<double>*, int)': velocity.cpp:(.text._ZN16QVectorTypedDataIdE4freeEPS0_i[QVectorTypedData<double>::free(QVectorTypedData<double>*, int)]+0x14): undefined reference toQVectorData::free(QVectorData*, int)'
    plot.o: In function QVector<QPointF>::malloc(int)': plot.cpp:(.text._ZN7QVectorI7QPointFE6mallocEi[QVector<QPointF>::malloc(int)]+0x35): undefined reference toQVectorData::allocate(int, int)'
    plot.cpp:(.text._ZN7QVectorI7QPointFE6mallocEi[QVector<QPointF>::malloc(int)]+0x43): undefined reference to qBadAlloc()' plot.o: In functionQVectorTypedData<QPointF>::free(QVectorTypedData<QPointF>, int)':
    plot.cpp:(.text._ZN16QVectorTypedDataI7QPointFE4freeEPS1_i[QVectorTypedData<QPointF>::free(QVectorTypedData<QPointF>
    , int)]+0x14): undefined reference to QVectorData::free(QVectorData*, int)' plot.o: In functionQVector<QPointF>::realloc(int, int)':
    plot.cpp:(.text._ZN7QVectorI7QPointFE7reallocEii[QVector<QPointF>::realloc(int, int)]+0x11a): undefined reference to qBadAlloc()' plot.cpp:(.text._ZN7QVectorI7QPointFE7reallocEii[QVector<QPointF>::realloc(int, int)]+0x18a): undefined reference toQVectorData::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



  • @qmake distclean@

    everything works now. Quite obvious, but well, this is my first qt app.

    Cheers.



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.