PDA

View Full Version : Compile Errors (porting Custom widget from Qt3 to Qt4)



degs2k4
7th February 2008, 13:11
Hello everyone,

I am trying to compile a Qt3 custom widget (named mycanvasview) in QDevelop under Qt4.

I haven't implemented the plugin for the c. widget yet, but I am getting the following errors when I try to compile the classes up to now (mycanvasview, bouncylogo, imageitem).

Even checking "qt3support" under Project properties is useless.

Maybe any problem with paths? What do you think?

Errors example:


debug\mycanvasview.o: In function `ZN12MyCanvasViewC2EP7QWidgetPKc':
C:/QDevelop/mycanvasviewplugin/mycanvasview.cpp:63: undefined reference to `_imp___ZN6QImageC1Ev'
C:/QDevelop/mycanvasviewplugin/mycanvasview.cpp:64: undefined reference to `_imp___ZN6QImage4loadERK7QStringPKc'


debug\moc_mycanvasview.o: In function `ZN12MyCanvasView6statusERK7QString':
C:/QDevelop/mycanvasviewplugin/debug/moc_mycanvasview.cpp:133: undefined reference to `_imp___ZN11QMetaObject8activateEP7QObjectPKS_iPPv '
debug\moc_mycanvasview.o: In function `ZSt17__verify_groupingPKcjRKSs':
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/locale_facets.tcc:2499: undefined reference to `QFrame::event(QEvent*)'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/locale_facets.tcc:2499: undefined reference to `QObject::timerEvent(QTimerEvent*)'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/locale_facets.tcc:2499: undefined reference to `QObject::childEvent(QChildEvent*)'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/locale_facets.tcc:2499: undefined reference to `QObject::customEvent(QEvent*)'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/locale_facets.tcc:2499: undefined reference to `QObject::connectNotify(char const*)'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/locale_facets.tcc:2500: undefined reference to `QObject::disconnectNotify(char const*)'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/locale_facets.tcc:2500: undefined reference to `QWidget::devType() const'


debug\imageitem.o: In function `ZN9ImageItemC2E6QImageP8Q3Canvas':
C:/QDevelop/mycanvasviewplugin/imageitem.cpp:27: undefined reference to `_imp___ZN6QImageC1ERKS_'
C:/QDevelop/mycanvasviewplugin/imageitem.cpp:27: undefined reference to `_imp___ZN7QPixmapC1Ev'
C:/QDevelop/mycanvasviewplugin/imageitem.cpp:28: undefined reference to `_imp___ZNK6QImage6heightEv'
C:/QDevelop/mycanvasviewplugin/imageitem.cpp:28: undefined reference to `_imp___ZNK6QImage5widthEv'
C:/QDevelop/mycanvasviewplugin/imageitem.cpp:31: undefined reference to `_imp___ZN7QPixmap9fromImageERK6QImage6QFlagsIN2Qt 19ImageConversionFlagEE'
C:/QDevelop/mycanvasviewplugin/imageitem.cpp:31: undefined reference to `QPixmap::~QPixmap()'
C:/QDevelop/mycanvasviewplugin/imageitem.cpp:31: undefined reference to `QPixmap::~QPixmap()'
C:/QDevelop/mycanvasviewplugin/imageitem.cpp:31: undefined reference to `QImage::~QImage()'


Thanks!

ChristianEhrlicher
7th February 2008, 14:37
QPixmap/QImage ctors and dtors are in QtGui lib - looks like you don't link against them.

degs2k4
7th February 2008, 22:04
Thanks Christian!!!

That certainly solved most of the problems. I linked to the libraries "gui" and "core", and the only error I am getting now is:


c:\Qt\4.3.2\lib/libqtmaind.a(qtmain_win.o): In function `WinMain':
C:/Qt/4.3.2/src/winmain/qtmain_win.cpp:120: undefined reference to `qMain(int, char**)'
collect2: ld returned 1 exit status

I have no idea about this one... I tried linking to windows libraries under project properties window, but i didn't solve the problem...

Does anyone know about this error?

degs2k4
7th February 2008, 22:18
OK, I just changed the .pro file from "TEMPLATE = app" to" TEMPLATE = lib", and the error went away.

Since initially was "TEMPLATE = app", then I think it was looking for a "main" function or sth in source files.

Thanks!!:)