PDA

View Full Version : Re-Compile an old project from 2007



raphaelf
6th September 2013, 08:13
Hi Guys,

I have an old project that need to be recompiled again and I would like to know, if I could use the latest qt version.

I used in 2007 the following tools:

OS: Win XP
Compiler: MinGW 4.1
QT: 4.1.1

Can somebody help me to be able to recompile the project again? The reason I have to recompile is because I need to change some code.

Best Regards

Raphael

anda_skoa
6th September 2013, 09:58
You could try with the lastet Qt4 version, there shouldn't be that much change there.

Cheers,
_

raphaelf
6th September 2013, 12:01
Hi!

Thank you for your answer. I have installed the 4.1.1 Version and I have some errors. Is there maybe missing a path or a project file entry?

Project File:


################################################## ####################
# Automatically generated by qmake (2.00a) Fr 6. Sep 11:44:48 2013
################################################## ####################

TEMPLATE = app
TARGET +=
DEPENDPATH += .
INCLUDEPATH += .
QT += sql
QT += qt3support



# Input
HEADERS += abfrage.h \
admineditor.h \
bemerkungdialog.h \
ergebnisse.h \
gotodialog.h \
licensedialog.h \
licensemanagement.h \
lizenzerweiterndialog.h \
login.h \
mainwindow.h \
softwaredialog.h \
softwaremover.h \
update.h \
updatelicensedialog.h
SOURCES += abfrage.cpp \
admineditor.cpp \
bemerkungdialog.cpp \
ergebnisse.cpp \
gotodialog.cpp \
licensedialog.cpp \
licensemanagement.cpp \
lizenzerweiterndialog.cpp \
login.cpp \
main.cpp \
mainwindow.cpp \
qmake_image_collection.cpp \
softwaredialog.cpp \
softwaremover.cpp \
update.cpp \
updatelicensedialog.cpp




Erros:



D:\1Data\public\ITInventarMigration\Code\18.10.07\ inventar>make
qmake -win32 -o Makefile inventar.pro
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `D:/1Data/public/ITInventarMigration/Code/18
.10.07/inventar'
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_D
LL -DQT_NO_DEBUG -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_GUI_LIB -DQ
T_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.1/include/QtCore" -
I"C:/Qt/4.1.1/include/QtGui" -I"C:/Qt/4.1.1/include/QtSql" -I"C:/Qt/4.1.1/includ
e/Qt3Support" -I"C:/Qt/4.1.1/include" -I"." -I"C:/Qt/4.1.1/include/ActiveQt" -I"
release" -I"." -I"C:/Qt/4.1.1/mkspecs/win32-g++" -o release\abfrage.o abfrage.cp
p
In file included from C:/Qt/4.1.1/include/QtCore/qrect.h:1:0,
from C:/Qt/4.1.1/include/QtGui/../../src/gui/painting/qpaintdev
ice.h:28,
from C:/Qt/4.1.1/include/QtGui/qpaintdevice.h:1,
from C:/Qt/4.1.1/include/QtGui/../../src/gui/kernel/qwidget.h:2
9,
from C:/Qt/4.1.1/include/QtGui/qwidget.h:1,
from C:/Qt/4.1.1/include/QtGui/../../src/gui/dialogs/qdialog.h:
27,
from C:/Qt/4.1.1/include/QtGui/qdialog.h:1,
from abfrage.h:14,
from abfrage.cpp:11:
C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qrect.h:138:38: warning: inli
ne function 'bool operator==(const QRect&, const QRect&)' declared as dllimport
: attribute ignored [-Wattributes]
C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qrect.h:139:38: warning: inli
ne function 'bool operator!=(const QRect&, const QRect&)' declared as dllimport
: attribute ignored [-Wattributes]
C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qrect.h:166:27: warning: inli
ne function 'bool operator==(const QRect&, const QRect&)' declared as dllimport
: attribute ignored [-Wattributes]
C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qrect.h:167:27: warning: inli
ne function 'bool operator!=(const QRect&, const QRect&)' declared as dllimport
: attribute ignored [-Wattributes]
C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qrect.h:560:38: warning: inli
ne function 'bool operator==(const QRectF&, const QRectF&)' declared as dllimpo
rt: attribute ignored [-Wattributes]
C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qrect.h:561:38: warning: inli
ne function 'bool operator!=(const QRectF&, const QRectF&)' declared as dllimpo
rt: attribute ignored [-Wattributes]
C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qrect.h:573:27: warning: inli
ne function 'bool operator==(const QRectF&, const QRectF&)' declared as dllimpo
rt: attribute ignored [-Wattributes]
C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qrect.h:574:27: warning: inli
ne function 'bool operator!=(const QRectF&, const QRectF&)' declared as dllimpo
rt: attribute ignored [-Wattributes]
In file included from C:/Qt/4.1.1/include/QtGui/qrgb.h:1:0,
from C:/Qt/4.1.1/include/QtGui/../../src/gui/painting/qcolor.h:
27,
from C:/Qt/4.1.1/include/QtGui/qcolor.h:1,
from C:/Qt/4.1.1/include/QtGui/../../src/gui/kernel/qpalette.h:
28,
..
..
..

amleto
7th September 2013, 03:48
there aren't any errors there...

raphaelf
9th September 2013, 09:09
Hi amleto,

sorry for that my error has 29'635 characters and its only 1'000 allowed. I have attached the complete error code. Have you or somebody an idea?

anda_skoa
9th September 2013, 14:34
You indicated earlier that you had used Qt4 before, but that looks a lot like Qt3 code.

For example addMultiCellWidget in QGridLayout got replaced by addWidget having additional row-span and column-span arguments.

QListView got replaced with QListWidget, thus it is now QListWidgetItem instead of QListViewItem.

Cheers,
_

wysota
9th September 2013, 15:30
You indicated earlier that you had used Qt4 before, but that looks a lot like Qt3 code.

For example addMultiCellWidget in QGridLayout got replaced by addWidget having additional row-span and column-span arguments.

QListView got replaced with QListWidget, thus it is now QListWidgetItem instead of QListViewItem.

It might be using Qt3 compatibility layer.

raphaelf
9th September 2013, 15:54
Hi Guys,

Yes I used qt3 compatibility later.

I have installed QT 4.8.4 now and minGW 4.4 on a XP Machine. Now I have compiled again and have "only" these errors:

Is there a magic line to add on my project file to compile this old project again? Any chance?? :confused:



C:\Documents and Settings\Administrator\Desktop\18.10.07\inventar>qmake

C:\Documents and Settings\Administrator\Desktop\18.10.07\inventar>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Documents and Settings/Administrator/Des
ktop/18.10.07/inventar'
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_LARGE
FILE_SUPPORT -DQT_DLL -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_GUI_LI
B -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQ
T_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.8.4\include\QtCore"
-I"c:\Qt\4.8.4\include\QtGui" -I"c:\Qt\4.8.4\include\QtSql" -I"c:\Qt\4.8.4\inclu
de\Qt3Support" -I"c:\Qt\4.8.4\include" -I"." -I"c:\Qt\4.8.4\include\ActiveQt" -I
"debug" -I"c:\Qt\4.8.4\mkspecs\default" -o debug\abfrage.o abfrage.cpp
In file included from abfrage.cpp:11:
abfrage.h:30: error: 'WFlags' has not been declared
In file included from abfrage.cpp:12:
ergebnisse.h:32: error: 'WFlags' has not been declared
In file included from abfrage.cpp:13:
mainwindow.h:53: error: 'WFlags' has not been declared
mainwindow.h:53: error: 'WType_TopLevel' was not declared in this scope
abfrage.cpp:34: error: 'WFlags' has not been declared
abfrage.cpp: In constructor 'Abfrage::Abfrage(QWidget*, const char*, bool, int)'
:
abfrage.cpp:35: error: conversion from 'int' to 'Qt::WindowFlags' is ambiguous
c:\Qt\4.8.4\include/QtCore/../../src/corelib/global/qglobal.h:2311: note: candid
ates are: QFlags<Enum>::QFlags(void**) [with Enum = Qt::WindowType] <near match>

c:\Qt\4.8.4\include/QtCore/../../src/corelib/global/qglobal.h:2310: note:
QFlags<Enum>::QFlags(Enum) [with Enum = Qt::WindowType] <near match>
abfrage.cpp:70: error: 'WState_Polished' was not declared in this scope
abfrage.cpp:70: error: 'clearWState' was not declared in this scope
abfrage.cpp: In member function 'virtual void Abfrage::openErgebnis()':
abfrage.cpp:144: error: invalid use of incomplete type 'struct QListViewItem'
ergebnisse.h:20: error: forward declaration of 'struct QListViewItem'
abfrage.cpp:163: error: invalid use of incomplete type 'struct QListViewItem'
ergebnisse.h:20: error: forward declaration of 'struct QListViewItem'
abfrage.cpp:185: error: invalid use of incomplete type 'struct QListViewItem'
ergebnisse.h:20: error: forward declaration of 'struct QListViewItem'
abfrage.cpp:207: error: invalid use of incomplete type 'struct QListViewItem'
ergebnisse.h:20: error: forward declaration of 'struct QListViewItem'
abfrage.cpp:232: error: invalid use of incomplete type 'struct QListViewItem'
ergebnisse.h:20: error: forward declaration of 'struct QListViewItem'
abfrage.cpp:258: error: invalid use of incomplete type 'struct QListViewItem'
ergebnisse.h:20: error: forward declaration of 'struct QListViewItem'
abfrage.cpp:265: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:266: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:267: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:268: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:269: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:289: error: invalid use of incomplete type 'struct QListViewItem'
ergebnisse.h:20: error: forward declaration of 'struct QListViewItem'
abfrage.cpp:297: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:298: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:299: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:300: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:301: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:315: error: invalid use of incomplete type 'struct QListViewItem'
ergebnisse.h:20: error: forward declaration of 'struct QListViewItem'
abfrage.cpp:321: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:322: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:323: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:324: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:325: error: 'class QListView' has no member named 'setColumnText'
abfrage.cpp:334: error: invalid use of incomplete type 'struct QListViewItem'
ergebnisse.h:20: error: forward declaration of 'struct QListViewItem'
mingw32-make[1]: *** [debug/abfrage.o] Error 1
mingw32-make[1]: Leaving directory `C:/Documents and Settings/Administrator/Desk
top/18.10.07/inventar'
mingw32-make: *** [debug] Error 2

C:\Documents and Settings\Administrator\Desktop\18.10.07\inventar>


Here my project file:


################################################## ####################
# Automatically generated by qmake (1.07a) Di 14. Feb 13:36:06 2006
################################################## ####################

TEMPLATE = app
INCLUDEPATH += .
QT += sql
QT += qt3support


# Input
HEADERS += abfrage.h \
admineditor.h \
bemerkungdialog.h \
ergebnisse.h \
gotodialog.h \
licensedialog.h \
licensemanagement.h \
lizenzerweiterndialog.h \
login.h \
mainwindow.h \
softwaredialog.h \
softwaremover.h \
update.h \
updatelicensedialog.h
SOURCES += abfrage.cpp \
admineditor.cpp \
bemerkungdialog.cpp \
ergebnisse.cpp \
gotodialog.cpp \
licensedialog.cpp \
licensemanagement.cpp \
lizenzerweiterndialog.cpp \
login.cpp \
main.cpp \
mainwindow.cpp \
softwaredialog.cpp \
softwaremover.cpp \
update.cpp \
updatelicensedialog.cpp


IMAGES = images/editcut \
images/editpaste \
images/filenew \
images/fileopen \
images/filesave \
images/print \
images/redo \
images/searchfind \
images/undo \
images/table.png \
images/delete.png \
images/find.png \
images/new.png \
images/leftarrow.png \
images/rightarrow.png \
images/Grafik1.png \
images/icon_13.png \
images/gotocell.png \
images/undo_1.png \
images/redo_1.png \
images/next.png \
images/previous.png \
images/logo1.png \
images/home.png \
images/icon.png \
images/question_icon.png \
images/generic.png \
images/sqlserver.jpg \
images/login.jpg \
images/goto.png

wysota
9th September 2013, 16:05
It's not a matter of the project file. The source code is incorrect, e.g. it is missing some include statements.

raphaelf
10th September 2013, 11:32
Hi Wysota,

the code should be fine because I was able to generate the exe file in the year 2007. Is maybe because I am not using the same mingw version and qt version? I think that I used qt 4.1.1 and mingw 4.1 in 2007. Now I am using qt 4.8.4 and mingw 4.4.

It would be nice to be able to compile the project again without to change the code.

What would you suggest?

ChrisW67
11th September 2013, 02:40
the code should be fine because I was able to generate the exe file in the year 2007
You really think nothing has changed in Qt during the past 6 years?

What would you suggest?
Some of your source code files are missing includes. There is no way to magically change this without modifying the source.

abfrage.cpp needs:


#include <QListViewItem>

to get rid of most errors.

abfrage.h needs to include something that pulls in the Qt namespace before it tries to use the WFlags typedef. Almost any widget related include will do it, so you might just be able to reorder existing includes to achieve this.

If the ambiguous conversion error persists after fixing those then you'll need to work out how to address that.

raphaelf
11th September 2013, 13:06
Hi Guys,

I found out that I used qt 3.3.4. I have installed qt 3.3.4 and was able to compile again. Thank you again!