Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to compile Qt5.8 for QNX7 ?: (16 Items)
   
How to compile Qt5.8 for QNX7 ?  
Anyone has a detailed procedure to compile Qt5.8 for QNX7 (armv7le) ?

Nicolas
Re: How to compile Qt5.8 for QNX7 ?  
From git on...Linux?

source ~/qnx700/qnxsdp-env.sh
git clone git://code.qt.io/qt/qt5.git qt58
cd qt58
git checkout 5.8
./init-repository --module-subset=default,-qtwebkit,-qtwebkit-examples,-qtwebengine,-qtwebchannel
cd ..
mkdir qt58-build
cd qt58-build
mkdir int result
cd int
../../qt58/configure -prefix /usr/qt5 -extprefix $HOME/qt58-build/result -xplatform qnx-armle-v7-qcc -opensource -
confirm-license -release -nomake examples -nomake tests -force-debug-info -separate-debug-info
make -j4
make install

Building for 64-bit targets (aarch64le or x86_64) is a bit more difficult because the mkspecs are currently broken.

Windows should be similar.

QtMultimedia won't work because the QNX Multimedia component hasn't been released yet.  It'll build; it just won't be of
 any use.

You might have to drop other repositories if they won't build for QNX.

Re: How to compile Qt5.8 for QNX7 ?  
Hi James,

Thanks for your answer.
I'm currently using 32 bit arm target. So, I'm not concerned about 64 bit broken files.
However, I'm currently using Windows for dev. I am not successful cross compiling with Windows.
The commands you use are similar to the ones I use. I always end with an error somewhere.
Maybe I have to setup up a Linux box or VM.
Keep trying...

Nicolas
Re: How to compile Qt5.8 for QNX7 ?  
What's your host compiler?  As far as I know, the only one that will work is MinGW.
Re: How to compile Qt5.8 for QNX7 ?  
I tried VS2015 but as expected, it does not work. MAKEFLAGS set in qnxsdp-env.bat is problematic.

I also tried with MinGW64 (modern MinGW) but got an error after a while.
Maybe I have to try with MinGW...
Re: How to compile Qt5.8 for QNX7 ?  
I use MinGW-W64 (4.9.2) to build on Windows.  On Windows, you have to use short paths or the Qt source paths get 
truncated because they're too deep.  I tried the following just now (assumes 5.8 Qt source is in \QtD\58\s):

Open a MinGW-W64 terminal
%HOMEPATH%/qnx700/qnxsdp-env.bat
mkdir \QtD\58\qrai \QtD\58\qrar
cd \QtD\58\qrai
C:\QtD\58\s\configure.bat -prefix /usr/qt5 -extprefix C:\QtD\58\qrar -xplatform qnx-armle-v7-qcc -opensource -confirm-
license -release -nomake examples -nomake tests -force-debug-info -separate-debug-info
make -j4 module-qtbase
make module-qtbase-install_subtargets
Re: How to compile Qt5.8 for QNX7 ?  
I still get the same error when running configure.bat. After a while, I get :

g++ -o "../bin/qmake.exe" project.o option.o property.o main.o ioutils.o proitems.o qmakevfs.o qmakeglobals.o 
qmakeparser.o qmakeevaluator.o qmakebuiltins.o makefile.o unixmake2.o unixmake.o mingw_make.o winmakefile.o 
projectgenerator.o meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o msvc_vcproj.o msvc_vcxproj.o 
msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o qtextcodec.o qutfcodec.o qstring.o qstring_compat.o qstringbuilder
.o qtextstream.o qiodevice.o qringbuffer.o qdebug.o qmalloc.o qglobal.o qarraydata.o qbytearray.o qbytearraymatcher.o 
qdatastream.o qbuffer.o qlist.o qfiledevice.o qfile.o qfilesystementry.o qfilesystemengine.o qfsfileengine.o 
qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o 
qstringlist.o qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o 
qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlinkedlist.o qnumeric.o qcryptographichash.o qxmlstream.o qxmlutils.o
 qlogging.o qjson.o qjsondocument.o qjsonparser.o qjsonarray.o qjsonobject.o qjsonvalue.o qfilesystemengine_win.o 
qfilesystemiterator_win.o qfsfileengine_win.o qlocale_win.o qsettings_win.o qsystemlibrary.o registry.o  -static -s -
lole32 -luuid -ladvapi32 -lkernel32 -Wl,--gc-sections
qsettings.o: In function `windowsConfigPath':
z:/QNX7/Qt/s/qtbase/src/corelib/io/qsettings.cpp:959: undefined reference to `SHGetKnownFolderPath'
collect2.exe: error: ld returned 1 exit status
Makefile:175: recipe for target '../bin/qmake.exe' failed
mingw32-make: *** [../bin/qmake.exe] Error 1
Building qmake failed, return code 2

Obviously, the problem appears at the link phase. 

Does the MinGW-W64 version is of importance ?
Re: How to compile Qt5.8 for QNX7 ?  
Uh, what version of Windows are you building on?  That's a Windows function that needs at least Windows Vista (or 
Windows Server 2008). I suspect that Qt's minimum Windows version is Windows 7.
Re: How to compile Qt5.8 for QNX7 ?  
I'm building on Windows10.
Upgrading MinGW-W64 to 5.3.0 solved the problem.

I've made some great progress.
I believe I have a working flow now.
I'll publish all the details when I have confirmed that the binaries are usable on the target..
Re: How to compile Qt5.8 for QNX7 ?  
Good news !!!  Qt applications are working correctly on the target !

Here are the steps I used to compile QT5.8 :

1) Install MinGW-W64 : 
I use version 5.3.0 (Qt wiki says Qt5.8 needs 5.3.0). 
If the installer works, you are lucky, else download the archive from Sourceforge. Here is the url I used : https://
netcologne.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/5.3.0/
threads-win32/sjlj/x86_64-5.3.0-release-win32-sjlj-rt_v4-rev0.7z

Extract the 7zip archive in c:\mingw-w64 (remove the first folder level of the archive when extracting).

2) Install Perl. 
Select latest ActivestatePerl (as stated somewhere in Qt wiki)

3) Open a DOS box (command prompt)

4) Create root directory
z:
mkdir QNX7
cd QNX7

5) Get Qt source code
git clone git://code.qt.io/qt/qt5.git qt58
cd qt58
git checkout 5.8
perl init-repository --module-subset=default,-qtwebkit,-qtwebkit-examples,-qtwebengine,-qtwebchannel

6) Build Qt
cd ..
mkdir qt58-build
cd qt58-build
mkdir int result
cd int
set PATH=c:\mingw-w64\bin;%PATH%
c:\qnx700\qnxsdp-env.bat
..\..\qt58\configure.bat -extprefix z:\QNX7\qt58-build\result -xplatform qnx-armle-v7-qcc -opensource -confirm-license -
release -nomake examples -nomake tests -force-debug-info -separate-debug-info
mingw32-make -j8
mingw32-make install

7) Configure momentics : 
Open the Preferences Dialog Box (Window/Preferences)
Select Qt in the left list
Remove the default entry
Add a new entry : In location, select Bowse and go to Z:\QNX7\qt58-build\result\bin\qmake.exe

You're done.
Re: How to compile Qt5.8 for QNX7 ?  
Thanks James for these instructions.  Worked perfectly on linux.

Only change I made was to put the default prefix at my traditional location (-prefix /opt/qt5).
Re: How to compile Qt5.8 for QNX7 ?  
>>>Building for 64-bit targets (aarch64le or x86_64) is a bit more difficult because the mkspecs are currently broken.

According to https://bugreports.qt.io/browse/QTBUG-59644 64-bit compiles were fixed in Qt 5.9.1.

I built Qt 5.9.2 for x86_64 and had no issues.
Re: How to compile Qt5.8 for QNX7 ?  
hello:
I want to know if I can be in compiling Qt5.8 under QNX6.6 ?
If can't, what are the limits?
Thanks.
Re: How to compile Qt5.8 for QNX7 ?  
It should build with QNX 6.6.  I'm not aware of any problems doing so but I haven't built the entirety of Qt 5.8 with 6.
6 recently.
Re: How to compile Qt5.8 for QNX7 ?  
Hello:
I compiled Qt5.6.2 succeeded; and specifies -opengl es2;
I think it is more convenient to use Qt5.6.2 development 3D, but failed, I'm in VM cannot be used SceneLoader components
 in QML;
Does not support openGL es2.0 ?
Re: How to compile Qt5.8 for QNX7 ?  
I followed the steps from Nicolas Pinault 03/31/2017 6:07 AM and was able to build Qt 58 successfully on 6.6 using 
mingw32.