views:

11

answers:

0

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.