Results 1 to 3 of 3

Thread: Migrating from Qt 4.8.x to 5.0.1

  1. #1
    Join Date
    Jun 2007
    Posts
    20
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Migrating from Qt 4.8.x to 5.0.1

    Hello,

    I'm migrating a project from Qt 4.8.x to 5.0.1 and the only thing which I can say at this moment is "wow, it's not a trivial job!!" After some hard work (test & error), I solved almost all the "errors" (updating deprecated code, libs, etc...) but there are two errors which I'm not capable to fix (ouch!!).

    I'm using the QMacCocoaViewContainer class (that compiles fine with Qt 4.8.x). Well, when I compile it using the Qt 5.0.1, the linker fails:

    Qt Code:
    1. Undefined symbols for architecture x86_64:
    2. "QMacCocoaViewContainer::qt_metacall(QMetaObject::Call, int, void**)", referenced from:
    3. WebViewNative::qt_metacall(QMetaObject::Call, int, void**) in moc_WebKitClass.o
    4. "QMacCocoaViewContainer::qt_metacast(char const*)", referenced from:
    5. WebViewNative::qt_metacast(char const*) in moc_WebKitClass.o
    6. "QMacCocoaViewContainer::setCocoaView(void*)", referenced from:
    7. WebViewNative::WebViewNative(QWidget*) in WebKitClass.o
    8. "QMacCocoaViewContainer::staticMetaObject", referenced from:
    9. WebViewNative::staticMetaObject in moc_WebKitClass.o
    10. "QMacCocoaViewContainer::QMacCocoaViewContainer(void*, QWidget*)", referenced from:
    11. WebViewNative::WebViewNative(QWidget*) in WebKitClass.o
    12. "QMacCocoaViewContainer::~QMacCocoaViewContainer()", referenced from:
    13. WebViewNative::WebViewNative(QWidget*) in WebKitClass.o
    14. WebViewNative::~WebViewNative() in moc_WebKitClass.o
    15. "QMacCocoaViewContainer::cocoaView() const", referenced from:
    16. WebViewNative::openURL(QString) in WebKitClass.o
    17. "typeinfo for QMacCocoaViewContainer", referenced from:
    18. typeinfo for WebViewNative in moc_WebKitClass.o
    19. ld: symbol(s) not found for architecture x86_64
    To copy to clipboard, switch view to plain text mode 
    The .pro has not been changed and I understand what the error says but I don't understand why it happens. I missed some extra configuration for Qt 5? Is a Qt5 bug? Because the Qt 5 for Mac is only 64bits (downloaded from Internet, not compiled by me).

    The specific configuration for this part in my project is:

    Qt Code:
    1. LIBS += -framework Cocoa -framework WebKit
    2. OBJECTIVE_SOURCES += src/webkit_mac/WebKitClass.mm
    3. HEADERS += src/webkit_mac/WebKitClass.h
    To copy to clipboard, switch view to plain text mode 
    I'll omit the second error by now, at this moment is commented in my code and don't breaks my compilation process (I'll try to fix it after...) I need to fix this before.

    Anyone know how to fix or why is it happening? Any help will be welcomed, I'm saturated at this time, hehehhe!

    Best regards,
    Xesc

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Migrating from Qt 4.8.x to 5.0.1

    You need to modify the .pro file and add QT += widgets -don't forget to run qmake after you add that- (there is a separate module for widgets in Qt 5) also you can read more here.

    You can read more about Qt 5 modules here.

  3. #3
    Join Date
    Jun 2007
    Posts
    20
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Migrating from Qt 4.8.x to 5.0.1

    Thank you Zlatomir,

    Thank you for your information, but I already added the QT += widgets in my PRO file and fixed all headers (I followed the information described here and here). I'm using the QtCreator 2.6.2 and Qt 5.0.1.

    I also tried creating a small and clean project (via QtCreator 2.6.2) and added a dummy class that extends from QMacCocoaViewContainer class with same results Undefined symbols for architecture x86_64... bla bla.

    I'm blocked here...

    Best regards,
    Xesc

    Edit:

    I found two posts related to mine: http://qt-project.org/forums/viewthread/25033 and http://qt-project.org/forums/viewthread/24654. Is there a Qt 5.0.1 bug?
    Last edited by xEsk; 2nd March 2013 at 11:57.

Similar Threads

  1. qss problem after migrating to 4.8
    By zgulser in forum Qt Programming
    Replies: 0
    Last Post: 2nd May 2012, 15:57
  2. Migrating from [ Qt 4.4 + VS 2005 ] - to - [ Qt 4.8 & vs 2010 ]
    By zgulser in forum Installation and Deployment
    Replies: 0
    Last Post: 14th April 2012, 22:20
  3. Replies: 2
    Last Post: 25th June 2010, 09:13
  4. Replies: 3
    Last Post: 4th February 2010, 19:10
  5. Migrating development XD
    By chaosgeorge in forum Installation and Deployment
    Replies: 10
    Last Post: 24th November 2006, 09:59

Tags for this Thread

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.