PDA

View Full Version : Cannot build Qt with gcc 5.1 on Windows 8.1.



smallB
19th July 2015, 18:36
I'm getting error msg:
zconf.h is missing.
After providing path to that file, in mkspec:


QMAKE_INCDIR = "C:\qt5_5_0\qt-everywhere-opensource-src-5.5.0\qtbase\include\QtZlib"

it compiles but doesn't link, gives following error:



C:/qt5_5_0/qt-everywhere-opensource-src-5.5.0/qtbase/lib/libQt5Bootstrap.a(qbyte
array.o):qbytearray.cpp:(.text$_Z11qUncompressPKhi +0x8f): undefined reference to `z_uncompress'
C:/qt5_5_0/qt-everywhere-opensource-src-5.5.0/qtbase/lib/libQt5Bootstrap.a(qbytearray.o):qbytearray.cpp:(.t ext$_Z9qCompressPKhii+0xbb): undefined reference to `z_compress2'
collect2.exe: error: ld returned 1 exit status

Any ideas how to fix it so I can build it?
Another question, when will there be available QT build for windows build with GCC5.2?

Thank you.

ChrisW67
19th July 2015, 22:33
The linker cannot find the library. How have you told the Qt configure where to find zlib? What version have you provided? You should not need to directly modify any build file to use the internal or an external zlib.


Configure ... -qt-zlib

http://doc.qt.io/qt-5/windows-building.html#step-3-set-the-environment-variables
http://doc.qt.io/qt-5/configure-options.html#third-party-libraries

You already have the source code to build Qt with with any suitably recent GCC suite. What are you waiting for?

smallB
20th July 2015, 11:00
Hi Chris,
So you're saying that I should've provide that -qt-zlib option to configure?
If I do not modify mkspec for g++ on windows I'll get error:
zconf.h cannot be found.

ChrisW67
20th July 2015, 15:27
You either use the zlib that is bundled with Qt (-qt-zlib), or you provide your own (-system-zlib) and tell configure where to find it from the command line (-I and -L options). The first option is easier, the second looks like this:


configure -system-zlib -I c:\zlib\include -L c:\zlib\lib

with suitable paths for the location you built/installed zlib. If you specify neither option then the configure (at least on Linux) defaults to system zlib.

Either way, you should not need to edit any of the Qt sources.

smallB
21st July 2015, 20:46
When follow your instructions and tried to build qt with following options:

configure.bat -release -platform win32-g++ -opengl desktop -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -skip webkit -nomake examples -nomake tests

and after running mingw32-make

this is the error I'm getting:
In file included from C:/TDM-GCC-64/x86_64-w64-mingw32/include/initguid.h:8:0,
from qaxscript.cpp:61:
C:/TDM-GCC-64/x86_64-w64-mingw32/include/activscp.h:470:1: error: redefinition of 'const GUID IID_IActiveScriptSite' DEFINE_GUID(IID_IActiveScriptSite, 0xdb01a1e3, 0xa42b, 0x11cf, 0x8f,0x20, 0x00,0x80,0x5f,0x2c,0xd0,0x64);
^

Any idea what to do with it?

Thanks

smallB
23rd July 2015, 13:24
So? No idea what to do next?

d_stranz
23rd July 2015, 18:36
Why don't you simply download the pre-built Qt 5.5.0 for Windows with mingw 4.9.2 from here (http://download.qt.io/official_releases/qt/5.5/5.5.0/qt-opensource-windows-x86-mingw492-5.5.0.exe)? Why do you need to build it from source?

smallB
23rd July 2015, 20:17
Un effing believable.
ChrisW64 says:
"You already have the source code to build Qt with with any suitably recent GCC suite. What are you waiting for? " - which I just shown that it cannot be built with GCC 5.1

and you are saying:
" why I don't simply download pre-built Qt 5.5.0 for Windows with mingw 4.9.2? "

Because I want to try new functionality provided by GCC 5.1 which is absent in GCC 4.9.2. That's why.

d_stranz
24th July 2015, 18:23
" why I don't simply download pre-built Qt 5.5.0 for Windows with mingw 4.9.2? "

Because I want to try new functionality provided by GCC 5.1 which is absent in GCC 4.9.2. That's why.

OK, so I missed that point.

You want to live on the bleeding edge, you have to be prepared to shed some of your own blood, not expect the people who are trying to help you to do the bleeding for you. You respond with abuse, you don't get more help in the future. Easy as that.

smallB
24th July 2015, 20:36
Please grow up Marry.

Not only you missed my point, you are also *unable* to help even if you wanted to, and you are like little girl who can't take the slightest criticism.
I didn't get any help so far, only mumblings of so called "expert" - one contradicting the other. Is that what you call help?

As a side note, how long was my original post and the consecutive ones that you missed my point? Do you have attention span of a fly?

ChrisW67
24th July 2015, 23:17
...and after running mingw32-make

this is the error I'm getting:
In file included from C:/TDM-GCC-64/x86_64-w64-mingw32/include/initguid.h:8:0,
from qaxscript.cpp:61:
C:/TDM-GCC-64/x86_64-w64-mingw32/include/activscp.h:470:1: error: redefinition of 'const GUID IID_IActiveScriptSite' DEFINE_GUID(IID_IActiveScriptSite, 0xdb01a1e3, 0xa42b, 0x11cf, 0x8f,0x20, 0x00,0x80,0x5f,0x2c,0xd0,0x64);
^

Any idea what to do with it?

If you don't need ActiveQt then configure it out of the build entirely. If you do need it then:
http://code.qt.io/cgit/qt/qtactiveqt.git/commit/?id=66e1ecc28e8bcb0b92ea0212caf611d99a80b0ce
http://sourceforge.net/p/mingw-w64/bugs/464/

I predict that will not be the only issue. If you want to play with the latest toolchains and and a large library of sources (feature freeze 16th Feb 2015) that pre-date the compiler (released 22 Apr) then you have to accept that there might be small problems like this. Fixes might exist for them but they will not arrive by magic, you have to seek them out in the latest developer version of the library/compiler source or on the dev mailing lists/IRC channels. It really did not take much to find this exact problem, a Qt workaround, and a reference to the MinGW bug on the front page of the ActiveQt Git repo. The problem itself is not in Qt.

BTW: Personal attacks will not help your cause, and might just get you banned.

smallB
25th July 2015, 13:46
@ChrisW67
Thank you. I really appreciate your answer and I'm really grateful for it.
As for personal attacks, just to point you out (and others who read this thread) that it was @d_stranz who actually attacked me personally and to which personal attack I've simply replied. It was not me who started attacking personally other members of this community.
If you go through posts exchange between me and you, surely you don't see me attacking you or behaving in any other way unpleasantly towards you, am I right?

And as a side note, although as much as I do appreciate your help, perhaps in the future instead of:

"You already have the source code to build Qt with with any suitably recent GCC suite. What are you waiting for? "

you should reply as you did in your last post, which occurred after I've pointed out that this^^^ is not really the case, so instead of the above you should rather say:

"I predict that will not be the only issue."

Thank you.

smallB
25th July 2015, 22:21
@ChrisW67
Hi, I've just managed to build qt with GCC 5.1. I do want to thank you for your help.
The command line I've used:
configure.bat -release -platform win32-g++ -opengl desktop -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -skip webkit -nomake examples -nomake tests -no-accessibility -skip activeqt

Thanks again.
Peace man.

ChrisW67
25th July 2015, 22:58
I could only possibly respond as I did in my last after you provided information about how Qt was failing to build with GCC 5.1 (your post #5). Your earlier posts had to do with failing to configure the build to match your environment, to which I provided suitable guidance.

D_Stranz asked why you were not using the ready-to-go build with the earlier GCC; a perfectly good question given you had not explained why you wanted a GCC 5.1/5.2 build and were clearly having difficulty. There's a wide range of reasons you might want to do that but not all of them justify the work. I don't think that question deserved anything other than a simple answer: "curiosity", " I need left-handed barbaz templating from GCC5.1 in other parts of the project", "I need ABI compatibility", or whatever.

I am glad you got there in the end.

As for your GCC 5.2 question: to provide a supported build the Qt team needs to establish a suitable continuous integration rig for MingW/GCC and then make the code go in a controlled way. I cannot remember seeing a commitment to do this in the near future. I would not expect it for at least a couple of Qt dot releases. Read/ask on the qt-dev mailing list for a reliable answer.