Results 1 to 4 of 4

Thread: Linking errors porting old Qt3 to Qt4

  1. #1
    Join Date
    Jul 2010
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Linking errors porting old Qt3 to Qt4

    Hello, I have to port an old Qt3 application to Qt4 and I am in a great hurry.
    (Not my mistake, but that's the way it is)

    With qt3to4 and some manual editing I have converted the old QSomeStuff to Q3SomeStuff and finally managed to compile the proggy.
    But linking is giving me problems

    g++ -Wl,-O1 -o TedQt AtomicChg.o BagOfCats.o CmdEffect.o Command.o CommandHistory.o CopyCmd.o DataTree.o DeleteNodeCmd.o DisplayNodeCmd.o EditFile.o EditTask.o FindToken.o main.o NewSuperAciCmd.o Node.o NodeExpert.o NodeKnowledge.o NodeKnowledgeTAP3_10.o NodeKnowledgeTAP3_11.o NodeKnowledgeTAP3_4.o PasteNodeCmd.o QtFileDialog.o QtFileNewDialog.o QtFilePreview.o QtFindCmd.o QtInsertAnyNodeCmd.o QtInsertNodeCmd.o QtNodeDualEditor.o QtSuperFindCmd.o QtTedListItem.o QtTedTableItem.o QtTreeViewer.o tedqtmainwindow.o TedUtilities.o TreeViewer.o UndoCmd.o moc_EditTask.o moc_QtFileDialog.o moc_QtFileNewDialog.o moc_QtFindCmd.o moc_QtInsertAnyNodeCmd.o moc_QtInsertNodeCmd.o moc_QtNodeDualEditor.o moc_QtSuperFindCmd.o moc_QtTedListItem.o moc_QtTreeViewer.o moc_tedqtmainwindow.o moc_tedqtmainwindowbase.o tedqtmainwindowbase.o -L/usr/lib -lQt3Support -lQtGui -lQtCore -lpthread

    Command.o: .rodata._ZTV6QGList vtable for QGList+0x18: undefined reference to `QGList::clear '
    Command.o: .rodata._ZTV6QGList vtable for QGList+0x20: undefined reference to `QGList::~QGList '
    Command.o: .rodata._ZTV6QGList vtable for QGList+0x28: undefined reference to `QGList::~QGList '
    Command.o: .rodata._ZTV6QGList vtable for QGList+0x30: undefined reference to `QPtrCollection::newItem void*'
    Command.o: .rodata._ZTV6QGList vtable for QGList+0x40: undefined reference to `QGList::compareItems void*, void*'
    Command.o: .rodata._ZTV6QGList vtable for QGList+0x48: undefined reference to `QGList::read QDataStream&, void*&'
    Command.o: .rodata._ZTV6QGList vtable for QGList+0x50: undefined reference to `QGList::write QDataStream&, void* const'
    Command.o: .rodata._ZTI6QGList typeinfo for QGList+0x10: undefined reference to `typeinfo for QPtrCollection'
    collect2: ld returned 1 exit status
    make: *** TedQt Error 1
    (Had to replace the brackets and parantheses or it would not let me post this thread ...)

    I have googled for this but didn't find anything that did help.
    For linking there is
    -lQt3Support -lQtGui -lQtCore
    on the command line, but QGList and QPtrCollection references are not satisfied.

    Any help is appreciated
    Thomas

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Linking errors porting old Qt3 to Qt4

    Can you post your .pro file?

    And tell exactly, step by step, how you built the code.

  3. #3
    Join Date
    Jul 2010
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Linking errors porting old Qt3 to Qt4

    cat tapir.pro:

    ################################################## ####################
    # Automatically generated by qmake (2.01a) Fri Jul 30 11:33:34 2010
    ################################################## ####################

    TEMPLATE = app
    TARGET = TedQt
    DEPENDPATH += .
    INCLUDEPATH += .

    # Removed QtNodeEditor.h from HEADERS
    # This file was neither in the old TedQt.pro nor in Makefile!

    # Input
    HEADERS += AtomicChg.h \
    BagOfCats.h \
    CHstrings.h \
    CmdEffect.h \
    Command.h \
    CommandHistory.h \
    CopyCmd.h \
    DataTree.h \
    DeleteNodeCmd.h \
    DisplayNodeCmd.h \
    EditFile.h \
    EditNodeCmd.h \
    EditTask.h \
    FindToken.h \
    NewSuperAciCmd.h \
    Node.h \
    NodeExpert.h \
    NodeKnowledge.h \
    NodeKnowledgeTAP3_10.h \
    NodeKnowledgeTAP3_11.h \
    NodeKnowledgeTAP3_4.h \
    Observable.h \
    Observer.h \
    PasteNodeCmd.h \
    QtFileDialog.h \
    QtFileNewDialog.h \
    QtFilePreview.h \
    QtFindCmd.h \
    QtInsertAnyNodeCmd.h \
    QtInsertNodeCmd.h \
    QtNodeDualEditor.h \
    QtSuperFindCmd.h \
    QtTedListItem.h \
    QtTedTableItem.h \
    QtTreeViewer.h \
    StdAfx.h \
    tap3_tags.h \
    tedqtmainwindow.h \
    tedqtmainwindowbase.h \
    TedUtilities.h \
    TreeViewer.h \
    UndoCmd.h \
    tapir_background_with_tapir_450x450_svr.xpm \
    filesave.xpm \
    fileopen.xpm \
    editundo.xpm \
    search.xpm \
    fileclose.xpm \
    tapirlogo.xpm \
    svrlogo.xpm

    #FORMS += tedqtmainwindowbase.ui

    SOURCES += AtomicChg.cpp \
    BagOfCats.cpp \
    CmdEffect.cpp \
    Command.cpp \
    CommandHistory.cpp \
    CopyCmd.cpp \
    DataTree.cpp \
    DeleteNodeCmd.cpp \
    DisplayNodeCmd.cpp \
    EditFile.cpp \
    EditTask.cpp \
    FindToken.cpp \
    main.cpp \
    NewSuperAciCmd.cpp \
    Node.cpp \
    NodeExpert.cpp \
    NodeKnowledge.cpp \
    NodeKnowledgeTAP3_10.cpp \
    NodeKnowledgeTAP3_11.cpp \
    NodeKnowledgeTAP3_4.cpp \
    PasteNodeCmd.cpp \
    QtFileDialog.cpp \
    QtFileNewDialog.cpp \
    QtFilePreview.cpp \
    QtFindCmd.cpp \
    QtInsertAnyNodeCmd.cpp \
    QtInsertNodeCmd.cpp \
    QtNodeDualEditor.cpp \
    QtSuperFindCmd.cpp \
    QtTedListItem.cpp \
    QtTedTableItem.cpp \
    QtTreeViewer.cpp \
    tedqtmainwindow.cpp \
    tedqtmainwindowbase.cpp \
    TedUtilities.cpp \
    TreeViewer.cpp \
    UndoCmd.cpp

    #The following line was changed from FORMS to FORMS3 by qt3to4
    FORMS3 = \
    tedqtmainwindowbase.ui

    DEFINES = \
    UNIX_X11
    #The following line was inserted by qt3to4
    QT += qt3support

    ## Thomas Hahn, removed, as we have difficulties handling the old *.ui file
    #The following line was inserted by qt3to4
    CONFIG += uic3

    qmake -project
    edit the file because of our special requirements
    (QtNodeEditor.h is only a header file, but no *.cpp for it, so remove it from
    the file list, tedqtmainwindowbase.o was 2 times in the list of objects, removed
    1 time from Makefile)
    qmake -unix
    edit Makefile, removed -Wall
    touch on old *.ui
    make

  4. #4
    Join Date
    Jul 2010
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Linking errors porting old Qt3 to Qt4


    Shame on me.
    After make clean all everything linked just fine.

Similar Threads

  1. Errors linking to a Symbian DLL
    By zhengping in forum Qt Programming
    Replies: 0
    Last Post: 5th July 2010, 10:47
  2. Link errors when linking chained libraries on windows
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2008, 14:52
  3. Replies: 2
    Last Post: 15th February 2008, 01:21
  4. Compile Errors (porting Custom widget from Qt3 to Qt4)
    By degs2k4 in forum Qt Programming
    Replies: 3
    Last Post: 7th February 2008, 22:18
  5. Porting from Qt3 to Qt4
    By vermarajeev in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2007, 05:27

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.