Results 1 to 4 of 4

Thread: Compile Errors (porting Custom widget from Qt3 to Qt4)

  1. #1
    Join Date
    Jan 2008
    Posts
    26
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Compile Errors (porting Custom widget from Qt3 to Qt4)

    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:

    Qt Code:
    1. debug\mycanvasview.o: In function `ZN12MyCanvasViewC2EP7QWidgetPKc':
    2. C:/QDevelop/mycanvasviewplugin/mycanvasview.cpp:63: undefined reference to `_imp___ZN6QImageC1Ev'
    3. C:/QDevelop/mycanvasviewplugin/mycanvasview.cpp:64: undefined reference to `_imp___ZN6QImage4loadERK7QStringPKc'
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. debug\moc_mycanvasview.o: In function `ZN12MyCanvasView6statusERK7QString':
    2. C:/QDevelop/mycanvasviewplugin/debug/moc_mycanvasview.cpp:133: undefined reference to `_imp___ZN11QMetaObject8activateEP7QObjectPKS_iPPv'
    3. debug\moc_mycanvasview.o: In function `ZSt17__verify_groupingPKcjRKSs':
    4. 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*)'
    5. 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*)'
    6. 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*)'
    7. 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*)'
    8. 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*)'
    9. 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*)'
    10. 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'
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. debug\imageitem.o: In function `ZN9ImageItemC2E6QImageP8Q3Canvas':
    2. C:/QDevelop/mycanvasviewplugin/imageitem.cpp:27: undefined reference to `_imp___ZN6QImageC1ERKS_'
    3. C:/QDevelop/mycanvasviewplugin/imageitem.cpp:27: undefined reference to `_imp___ZN7QPixmapC1Ev'
    4. C:/QDevelop/mycanvasviewplugin/imageitem.cpp:28: undefined reference to `_imp___ZNK6QImage6heightEv'
    5. C:/QDevelop/mycanvasviewplugin/imageitem.cpp:28: undefined reference to `_imp___ZNK6QImage5widthEv'
    6. C:/QDevelop/mycanvasviewplugin/imageitem.cpp:31: undefined reference to `_imp___ZN7QPixmap9fromImageERK6QImage6QFlagsIN2Qt19ImageConversionFlagEE'
    7. C:/QDevelop/mycanvasviewplugin/imageitem.cpp:31: undefined reference to `QPixmap::~QPixmap()'
    8. C:/QDevelop/mycanvasviewplugin/imageitem.cpp:31: undefined reference to `QPixmap::~QPixmap()'
    9. C:/QDevelop/mycanvasviewplugin/imageitem.cpp:31: undefined reference to `QImage::~QImage()'
    To copy to clipboard, switch view to plain text mode 


    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Compile Errors (porting Custom widget from Qt3 to Qt4)

    QPixmap/QImage ctors and dtors are in QtGui lib - looks like you don't link against them.

  3. The following user says thank you to ChristianEhrlicher for this useful post:

    degs2k4 (7th February 2008)

  4. #3
    Join Date
    Jan 2008
    Posts
    26
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Re: Compile Errors (porting Custom widget from Qt3 to Qt4)

    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:

    Qt Code:
    1. c:\Qt\4.3.2\lib/libqtmaind.a(qtmain_win.o): In function `WinMain':
    2. C:/Qt/4.3.2/src/winmain/qtmain_win.cpp:120: undefined reference to `qMain(int, char**)'
    3. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

    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?

  5. #4
    Join Date
    Jan 2008
    Posts
    26
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Smile Re: Compile Errors (porting Custom widget from Qt3 to Qt4)

    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!!

Similar Threads

  1. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 14:06
  2. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38
  3. Custom tab widget question
    By PrimeCP in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 11:17
  4. Replies: 2
    Last Post: 25th August 2006, 11:35
  5. Replies: 4
    Last Post: 24th March 2006, 22:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.