PDA

View Full Version : gcc 4.1.1 and qt 4.2 installation problem



dave
15th October 2006, 11:21
Hi

When I try to configure & compile the qt 4.2 OS edition I get the following error:


g++ -c -oqlocale.o -O -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -I..\src\corelib\arch\generic -I..\include -I ..\include\QtCore -I..\src\tools -I..\mkspecs\win32-g++ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQMAKE_OPENSOURCE_EDITION ..\src\corelib\tools\qlocale.cpp
..\src\corelib\tools\qlocale.cpp: In function 'char* qdtoa(double, int, int, int*, int*, char**, char**)':
..\src\corelib\tools\qlocale.cpp:5630: error: '_clear87' was not declared in this scope
..\src\corelib\tools\qlocale.cpp:5631: error: '_control87' was not declared in this scope
mingw32-make: *** [qlocale.o] Error 1


If it will help I'm running xp sp2 on athlon amd using gcc 4.11
this is what the configure script start with:

$ configure -qt-gif

This is the Qt/Windows Open Source Edition.

You are licensed to use this software under the terms of
the GNU General Public License.

Type '?' to view the GNU General Public License.
Type 'y' to accept this license offer.
Type 'n' to decline this license offer.

Do you accept the terms of the license?
y
Environment:
INCLUDE=
Unset
LIB=
Unset
PATH=
.
C:\msys\1.0\local\bin
C:\msys\1.0\mingw\bin
C:\msys\1.0\bin
c:\WINDOWS\system32
c:\WINDOWS
c:\WINDOWS\System32\Wbem
c:\Program Files\Common Files\Adobe\AGL
c:\Program Files\QuickTime\QTSystem\
C:\msys\1.0\mingw\bin\
You are licensed to use this software under the terms of the GNU GPL.
See C:\qt\4.2.0/LICENSE.GPL

Configuration:
minimal-config
small-config
medium-config
large-config
full-config
build_all
debug
Qt Configuration:
release
debug
zlib
png
accessibility
qt3support
opengl
ipv6

QMAKESPEC...................win32-g++ (detected)
Architecture................windows
Maketool....................mingw32-make
Debug symbols...............yes
Accessibility support.......yes
STL support.................yes
Exception support...........yes
RTTI support................yes
OpenGL support..............yes
Qt3 compatibility...........yes

Third Party Libraries:
ZLIB support............qt
GIF support.............plugin
JPEG support............plugin
PNG support.............qt
MNG support.............plugin

Styles:
Windows.................yes
Windows XP..............yes
Plastique...............yes
Cleanlooks..............yes
Motif...................yes
CDE.....................yes

Sql Drivers:
ODBC....................no
MySQL...................no
OCI.....................no
PostgreSQL..............no
TDS.....................no
DB2.....................no
SQLite..................yes
SQLite2.................no
InterBase...............no

Sources are in..............C:\qt\4.2.0
Build is done in............C:\qt\4.2.0
Install prefix..............C:\qt\4.2.0
Headers installed to........C:\qt\4.2.0\include
Libraries installed to......C:\qt\4.2.0\lib
Plugins installed to........C:\qt\4.2.0\plugins
Binaries installed to.......C:\qt\4.2.0\bin
Docs installed to...........C:\qt\4.2.0\doc
Data installed to...........C:\qt\4.2.0
Translations installed to...C:\qt\4.2.0\translations
Examples installed to.......C:\qt\4.2.0\examples
Demos installed to..........C:\qt\4.2.0\demos


gcc 4.11 was configured with
Configured with: --prefix=/mingw --host=mingw32 --target=mingw32 --program-prefix= --with-as=/mingw/bin/as.exe --with-ld=/mingw/bin/ld.exe --with-gcc --with-gnu-ld --with-gnu-as --enable-
threads --disable-nls --enable-languages=c,c++ --disable-win32-registry --disable-shared --without-x --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 4.1.1

Any idea what causes this error? Any help would be appreciated!

Thanks

ChristianEhrlicher
16th October 2006, 07:44
You've msys in your path which could make trouble. Also make sure that your compiler only grabs float.h from MinGW\include and not from msys or cygwin or anywhere else.
Also please try a precompiled gcc from mingw instead your own 4.1.1 as there are mostly some patches needed to get the correct behaviour.

dave
16th October 2006, 13:26
I canceled the msys path (run configure from cmd), still I get the same problem.

with mingw prebuilt binaries (mingw.org) it does work, bu I want to make it work with gcc 4.1.1 (mingw uses 3.4 I think). Where can I get those patches?

ChristianEhrlicher
16th October 2006, 13:40
Maybe ask at mingw.org mailing list. But I think you must only take care that your MinGWinclude\float.h from prebuild gcc3.x is used.

dave
17th October 2006, 20:10
Well, I haven't found the solution yet. I'm using now two different mingw config. the usual mingw 3.4.2 for qt, and my own mingw build (which includes gcc 4.1.1). As a matter of curiousity I've compared both float.h versions and they're identical!

I will try the mingw mailing list. will keep you updated if I find an answer.

dave
4th November 2006, 23:20
Turn out the problem wasn't with QT at all. Bu with my gcc 4.1.1 build which included the wrong float.h first. Apparently gcc should first search the local mingw include directory and then his own lib-gcc directory, which also has a float.h.

I downloaded a gcc 4.1.1 already compiled for mingw of the internet and it has the same problem.

I haven't found a way to change the include file search order yet.

Sergey Kuzmin
6th January 2007, 16:26
Root of that problem with float.h is 2 different version of this file

%MINGW%\include\float.h
%MINGW%\include\с++\4.1.1\float.h


The including %MINGW%\include\float.h are means also including
%MINGW%\include\с++\4.1.1\float.h, look at line "#include_next<float.h>"
The including %MINGW%\include\с++\4.1.1\float.h are means including
just one this file and losing _clear87 declaration.
Include dirs must be in right order (%MINGW%\include is first).

I use:

binutils-2.17.50-20060824.tar.gz
mingw-runtime-3.11.tar.gz
mingw-make-3.80.0-3.tar.gz
w32api-3.8.tar.gz
Compiled from source GCC version 4.1.1


To compile Qt 4.2.2 Open Source Edition with MinGW GCC 4.1.1 do this:


Create new environment variable with correct include dirs order:
CPLUS_INCLUDE_PATH=%MINGW%\include;%MINGW%\include \с++\4.1.1;%MINGW%\lib\gcc\mingw32\4.1.1\inclu de
(Or remove "#include_next<float.h>" in %MINGW%\include\float.h
and add "#include_next<float.h>" in %MINGW%\include\с++\4.1.1\float.h)
I don't know how compile %MINGW%\libexec\gcc\mingw32\4.1.1\cc1plus.exe with
correct inlude dir order inside. Please, tell me if you know.

(Correct several small bugs)
Add to begin of file %QTDIR%\src\corelib\kernel\qeventdispatcher_win.cp p
this declaration (any place before line 150: "QEventDispatcherWin32Private::~QEventDispatcherWin 32Private()"):

LRESULT CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp);

Replace line 578 in file %QTDIR%\src\gui\kernel\qkeymapper_win.cpp


from:
LCID newLCID = MAKELCID(GetKeyboardLayout(0), SORT_DEFAULT);
to:
LCID newLCID = MAKELCID(LOWORD(GetKeyboardLayout(0)), SORT_DEFAULT);

Add to begin of file %QTDIR%\src\gui\qwininputcontext_win.cpp
this declaration (any place before line 451: "bool QWinInputContext::endComposition()"):

extern bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event); // in qapplication_xxx.cpp

Compilation qaccessible_win.cpp will generate some errors.
I just "configure -no-accessibility"

Now you can complile Qt "mingw32-make".

P.S. Sorry my little English. My mother tongue is Russian.

Sergey Kuzmin
8th January 2007, 14:59
P.S. About 5. %QTDIR%\src\gui\accessible\qaccessible_win.cpp compilation problem.
I try to comment second interface at line 267:


class QWindowsAccessible : public IAccessible, /*IOleWindow,*/ QAccessible

Compilation was successful. After that I found this error in gcc bug database.
Take a look to description GCC Bugzilla Bug 27067 "Compile errors with multiple
inheritance where the stdcall attribute is applied to virtual functions"
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27067

I try to compile Qt 4.2.2 with snapshots gcc-4.1-20061219 and gcc-4.2-20070102,
both compilation was unsuccessful. Same errors "'x' aliased to undefined symbol".
Patch was not included in source tree.

brenden
23rd May 2008, 00:12
Anyone know the status of gcc 4 and Qt 4.4 with mingw? Is it still broken? I'm not sure why trolltech is ignoring this :confused:

ChristianEhrlicher
23rd May 2008, 07:53
Anyone know the status of gcc 4 and Qt 4.4 with mingw? Is it still broken? I'm not sure why trolltech is ignoring this :confused:

First - gcc 4.x on windows is alpha - it's not meant to something else than playing around. Why should TT care of something that isn't meant to be stable??
Second - The issues were reported after 4.4.0beta/rc was released and therefore it did not go into 4.4.0 final. Should they release 4.4.1 just because you want to use a compiler which only has alpha quality?

If you just want to play around (nothing more can be done with this compiler) you should also be able to fix such issues yourself. Otherwise it doesn't make sense that you use alpha software...

brenden
24th May 2008, 05:30
First - gcc 4.x on windows is alpha - it's not meant to something else than playing around. Why should TT care of something that isn't meant to be stable??
Second - The issues were reported after 4.4.0beta/rc was released and therefore it did not go into 4.4.0 final. Should they release 4.4.1 just because you want to use a compiler which only has alpha quality?

If you just want to play around (nothing more can be done with this compiler) you should also be able to fix such issues yourself. Otherwise it doesn't make sense that you use alpha software...

I have been patching it myself. I was just curious to know if it was working yet. I need gcc 4 (and I find it perfectly stable on windows) because I use tr1 in my project.

DaneAU
25th September 2011, 20:37
I found a workaround after experiencing the same issues described in this thread with Qt 4.8.0 Beta 1 and MinGW.

I found refuge in setting up some environmental variables withe the following variables in this order.



INCLUDE
C:\MinGW\include;C:\MinGW\lib\gcc\mingw32\4.6.1\in clude




LIB
C:\MinGW\lib\gcc\mingw32\4.6.1;C:\MinGW\lib


Now this got rid of the immediate displaying of failing to configure properly with undefined references in the file


Qt\src\corelib\tools\qlocale_tools.cpp


However later on down the track i found that the error came up, without reading through a few thousand lines of output i decided that the #include <float.h> at the top of this file may be best hard coded. I know this is not a good thing to do, however it did get me configured correctly. So edit it and input the full path to the file float.h

replace


#include <float.h>


With


#include "C:\\MinGW\\include\\float.h"


I did some reading on mailing lists and discovered that there is actually a problem with the MinGW specific to Qt and numerous people have raised the same question.

I know this is quite an old thread, however i stumbled onto it and figure perhaps others will also.