The gcc version used for compiling qt4.

2020-05-18 Thread Hongyi Zhao via Gcc
Hi,

I want to compile qt4 on Ubuntu 20.04 which shipped with the following
gcc version:

$ gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0

But I'm not sure whether this gcc version is suitable for qt4.  Any
hints for this problem?

Regards,
-- 
Hongyi Zhao 


Re: The gcc version used for compiling qt4.

2020-05-18 Thread Hongyi Zhao via Gcc
Jonathan Wakely  于2020年5月18日周一 下午8:49写道:
>
> On Mon, 18 May 2020 at 13:34, Hongyi Zhao via Gcc  wrote:
> >
> > Hi,
> >
> > I want to compile qt4 on Ubuntu 20.04 which shipped with the following
> > gcc version:
> >
> > $ gcc --version
> > gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
> >
> > But I'm not sure whether this gcc version is suitable for qt4.  Any
> > hints for this problem?
>
> Check the Qt4 docs, or just try it and see if it works.

Tried with qt4.8.7 but failed, see following for more info:

$ ./configure -no-openssl
$ make -j1
[...]
../../include/QtGui/../../src/gui/styles/qstyleoption.h:878:5: note:
because ‘QStyleOptionGraphicsItem’ has user-provided
‘QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(const
QStyleOptionGraphicsItem&)’
  878 | QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem
&other) : QStyleOption(Version, Type) { *this = other; }
  | ^~~~
dialogs/qprintdialog_unix.cpp: In destructor ‘virtual
QPrintPropertiesDialog::~QPrintPropertiesDialog()’:
dialogs/qprintdialog_unix.cpp:281:19: error: ‘class
Ui::QPrintPropertiesWidget’ has no member named ‘cupsPropertiesPage’
  281 | delete widget.cupsPropertiesPage;
  |   ^~
dialogs/qprintdialog_unix.cpp: In member function ‘void
QPrintPropertiesDialog::applyPrinterProperties(QPrinter*)’:
dialogs/qprintdialog_unix.cpp:287:12: error: ‘class
Ui::QPrintPropertiesWidget’ has no member named ‘pageSetup’
  287 | widget.pageSetup->setPrinter(p);
  |^
dialogs/qprintdialog_unix.cpp: In member function ‘void
QPrintPropertiesDialog::setupPrinter() const’:
dialogs/qprintdialog_unix.cpp:292:12: error: ‘const class
Ui::QPrintPropertiesWidget’ has no member named ‘pageSetup’
  292 | widget.pageSetup->setupPrinter();
  |^
dialogs/qprintdialog_unix.cpp: In member function ‘void
QPrintPropertiesDialog::selectPrinter()’:
dialogs/qprintdialog_unix.cpp:337:16: error: ‘class
Ui::QPrintPropertiesWidget’ has no member named ‘cupsPropertiesPage’
  337 | widget.cupsPropertiesPage->setEnabled(false);
  |^~
dialogs/qprintdialog_unix.cpp:338:16: error: ‘class
Ui::QPrintPropertiesWidget’ has no member named ‘pageSetup’
  338 | widget.pageSetup->selectPrinter(0);
  |^
dialogs/qprintdialog_unix.cpp: In member function ‘void
QPrintPropertiesDialog::selectPdfPsPrinter(const QPrinter*)’:
dialogs/qprintdialog_unix.cpp:345:12: error: ‘class
Ui::QPrintPropertiesWidget’ has no member named ‘pageSetup’
  345 | widget.pageSetup->selectPdfPsPrinter(p);
  |^
dialogs/qprintdialog_unix.cpp:346:12: error: ‘class
Ui::QPrintPropertiesWidget’ has no member named ‘tabs’
  346 | widget.tabs->setTabEnabled(1, false); // disable the advanced tab
  |^~~~
dialogs/qprintdialog_unix.cpp: In member function ‘void
QPrintDialogPrivate::init()’:
dialogs/qprintdialog_unix.cpp:389:13: error: ‘class
Ui::QPrintSettingsOutput’ has no member named ‘color’
  389 | options.color->setIconSize(QSize(32, 32));
  | ^
dialogs/qprintdialog_unix.cpp:390:13: error: ‘class
Ui::QPrintSettingsOutput’ has no member named ‘color’
  390 | 
options.color->setIcon(QIcon(QLatin1String(":/trolltech/dialogs/qprintdialog/images/status-color.png")));
  | ^
dialogs/qprintdialog_unix.cpp:391:13: error: ‘class
Ui::QPrintSettingsOutput’ has no member named ‘grayscale’
  391 | options.grayscale->setIconSize(QSize(32, 32));
  | ^
dialogs/qprintdialog_unix.cpp:392:13: error: ‘class
Ui::QPrintSettingsOutput’ has no member named ‘grayscale’
  392 | 
options.grayscale->setIcon(QIcon(QLatin1String(":/trolltech/dialogs/qprintdialog/images/status-gray-scale.png")));
  | ^
dialogs/qprintdialog_unix.cpp:421:30: error: ‘class
Ui::QPrintSettingsOutput’ has no member named ‘reverse’
  421 | QObject::connect(options.reverse, SIGNAL(toggled(bool)),
  |  ^~~
dialogs/qprintdialog_unix.cpp: In member function ‘void
QPrintDialogPrivate::applyPrinterProperties(QPrinter*)’:
dialogs/qprintdialog_unix.cpp:430:17: error: ‘class
Ui::QPrintSettingsOutput’ has no member named ‘color’
  430 | options.color->setChecked(true);
  | ^
dialogs/qprintdialog_unix.cpp:432:17: error: ‘class
Ui::QPrintSettingsOutput’ has no member named ‘grayscale’
  432 | options.grayscale->setChecked(true);
  | ^
dialogs/qprintdialog_unix.cpp:436:17: error: ‘class
Ui::QPrintSettingsOutput’ has no member named ‘noDuplex’
  436 | options.noDuplex->setChecked(true); break;
  | ^~~~
dialogs/qprintdialog_unix.cpp:439:17: error: ‘class
Ui::QPrintSe

Re: The gcc version used for compiling qt4.

2020-05-18 Thread Hongyi Zhao via Gcc
William Seurer  于2020年5月18日周一 下午10:52写道:
>
> On 5/18/20 9:35 AM, Hongyi Zhao via Gcc wrote:
> > Jonathan Wakely  于2020年5月18日周一 下午8:49写道:
> >> On Mon, 18 May 2020 at 13:34, Hongyi Zhao via Gcc  wrote:
> >>> Hi,
> >>>
> >>> I want to compile qt4 on Ubuntu 20.04 which shipped with the following
> >>> gcc version:
> >>>
> >>> $ gcc --version
> >>> gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
> >>>
> >>> But I'm not sure whether this gcc version is suitable for qt4.  Any
> >>> hints for this problem?
> >> Check the Qt4 docs, or just try it and see if it works.
> > Tried with qt4.8.7 but failed, see following for more info:
> >
> > $ ./configure -no-openssl
> > $ make -j1
> > [...]
> > dialogs/qprintdialog_unix.cpp:281:19: error: ‘class
> > Ui::QPrintPropertiesWidget’ has no member named ‘cupsPropertiesPage’
> >281 | delete widget.cupsPropertiesPage;
> >|   ^~
> >
> ...etc...
>
> Is "UI" part of the thing you are trying to build or something it uses
> from elsewhere?  Those sorts of errors look more like a configuration
> problem with #defines than a compiler problem.

The sourcecode is from here:

https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz

I inspect the ` ./configure --help ` and cannot figure out the options
corresponding to this problem.

> Are there some -D
> options you are missing?

IMO, -D option is mainly used by cmake, but make is used to comile qt4.

>
> If you want to try a different version of gcc it is not that hard to
> download and build.
>


-- 
Hongyi Zhao 


Re: The gcc version used for compiling qt4.

2020-05-18 Thread Hongyi Zhao via Gcc
William Seurer  于2020年5月18日周一 下午10:52写道:
>
> On 5/18/20 9:35 AM, Hongyi Zhao via Gcc wrote:
> > Jonathan Wakely  于2020年5月18日周一 下午8:49写道:
> >> On Mon, 18 May 2020 at 13:34, Hongyi Zhao via Gcc  wrote:
> >>> Hi,
> >>>
> >>> I want to compile qt4 on Ubuntu 20.04 which shipped with the following
> >>> gcc version:
> >>>
> >>> $ gcc --version
> >>> gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
> >>>
> >>> But I'm not sure whether this gcc version is suitable for qt4.  Any
> >>> hints for this problem?
> >> Check the Qt4 docs, or just try it and see if it works.
> > Tried with qt4.8.7 but failed, see following for more info:
> >
> > $ ./configure -no-openssl
> > $ make -j1
> > [...]
> > dialogs/qprintdialog_unix.cpp:281:19: error: ‘class
> > Ui::QPrintPropertiesWidget’ has no member named ‘cupsPropertiesPage’
> >281 | delete widget.cupsPropertiesPage;
> >|   ^~
> >
> ...etc...
>
> Is "UI" part of the thing you are trying to build or something it uses
> from elsewhere?  Those sorts of errors look more like a configuration
> problem with #defines than a compiler problem.  Are there some -D
> options you are missing?
>
> If you want to try a different version of gcc it is not that hard to
> download and build.

The README file of the qt4.8.7 source code told the following info:

---
INSTALLING Qt

If you have a source package (a .tar.gz, or .zip file), follow the
instructions in the INSTALL file.

On Windows and Mac OS X, if you want to install the precompiled binary
packages, simply launch the package and follow the instructions in the
installation wizard.

For Mac OS X Carbon, the binary package requires Mac OS X 10.4 (Tiger) or
later and GCC 4.0.1 to develop applications. Its applications will run
on Mac OS X 10.4 and above.

For Mac OS X Cocoa, the binary package requires Mac OS X 10.5 (Leopard) or
later and GCC 4.0.1 to develop applications.  Its applications will run
on Mac OS X 10.5 and above.


As you can see, it only told  the case for installing on Win / Mac OS,
and not the case for Linux.

Regards


>


-- 
Hongyi Zhao