PDA

View Full Version : Linking errors porting old Qt3 to Qt4



thahn01
30th July 2010, 12:42
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

tbscope
30th July 2010, 13:25
Can you post your .pro file?

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

thahn01
30th July 2010, 13:41
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

thahn01
30th July 2010, 20:00
:mad:
Shame on me.
After make clean all everything linked just fine.