PDA

View Full Version : QVariantAnimation instantiation runtime crash; symbol lookup error: undefined symbol



toglia3d
22nd June 2010, 17:12
I'm getting this weird runtime crash when instantiating QVariantAnimation or QPropertyAnimation. It appears this happens when the program doesn't link appropriately the class. But I have double checked my simple project and can't see anything wrong.


#include <QtCore/QVariantAnimation>
#include <QtCore/QEasingCurve>

class MyAnimacion : public QVariantAnimation {
public:
MyAnimacion() : QVariantAnimation() {}
~MyAnimacion(){}
void updateCurrentValue( const QVariant & value ) {}
};
int main() {
MyAnimacion myAnimacion;
return 0;
}

In Eclipse:
Qt Include Directory: /home/user/DEV/SDK/QtSDK/qt/include
Qt Link Directory: /home/user/DEV/SDK/QtSDK/qt/lib
Link Library: QtCore


make all
Building file: ../src/AnimationTest.cpp
Invoking: GCC C++ Compiler
g++ -I/home/user/DEV/SDK/QtSDK/qt/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/AnimationTest.d" -MT"src/AnimationTest.d" -o"src/AnimationTest.o" "../src/AnimationTest.cpp"
Finished building: ../src/AnimationTest.cpp

Building target: AnimationTest
Invoking: GCC C++ Linker
g++ -L/home/user/DEV/SDK/QtSDK/qt/lib -o"AnimationTest" ./src/AnimationTest.o -lQtCore
Finished building target: AnimationTest

Runtime Crash:

../AnimationTest: symbol lookup error: ../AnimationTest: undefined symbol: _ZN17QVariantAnimationC2EP7QObject

I don't know if QVariantAnimation is restricted to QtGui, I'm trying to use it to manually update the position of stuff in my game with the keyValueAt method.

toglia3d
22nd June 2010, 19:56
Ok. I figured out that if I create a QT Console project with Eclipse's QT plugin, this crash does not happen. So, there must be something missing in my c++ project configuration.

The strange thing is that this is not the first qt class I use in my current project. I was using a lot of QtCore classes and QtXml previous to this problem, and everything compiled, linked and worked. But for some reason this QVariantAnimation is crashing...

The only difference I can see is that "Qt projects" have this .pro file that normal C++ projects don't have. But I don't see anything special from it apart from specifying the code structure and used qt libs.

Thanks for any hint.