Win10 / Qt 5.4.2 Build

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Win10 / Qt 5.4.2 Build

Post by Nyyrazzilyss »

I've assemble a windows 10 Qt 5.4.2 mudlet build. This is being built in a virtualbox.

This -should- be easily duplicatable on any operating system. Virtualbox is a free cross platform package for virtual computers.

https://www.virtualbox.org/

Operating system image: (free for 90 days, then just rebuild)

Microsoft Edge on Win 10 Stable (13.10586)

https://developer.microsoft.com/en-us/m ... s/windows/

I increased the video memory of the image to 64mb, enabled audio, and changed the audio
controller to 'Intel HD Audio'

Inside the running virtualbox:

1) Windows setup

Microsoft 2013 c++ redistributables need to be installed (both x86 AND x64)

https://www.microsoft.com/en-ca/downloa ... x?id=40784

7-Zip: (You'll need to run the 7zip file manager to extract .7z files)

http://www.7-zip.org/a/7z1514-x64.exe

Notepad++: This will be needed to edit source files

https://notepad-plus-plus.org/repositor ... taller.exe

Add the path names that will be needed. Right click the start button, left click system.
Go to Advanced System Settings / Enviroment Variables

Add a new user variable 'PATH' of value
'c:\Python27;c:\Qt\Qt5.4.2\5.4\mingw491_32\bin;c:\mingw32\bin;c:\mingw32\lib;c:\Program Files (x86)\CMake\bin;"


2) Compile environment setup

Python 2.7.11: (This is needed in building zzlib)

https://www.python.org/ftp/python/2.7.1 ... 2.7.11.msi

Qt 5.4.2

http://download.qt.io/official_releases ... -5.4.2.exe

Mingw: (extract to c:\mingw32)

http://sourceforge.net/projects/mingwbu ... six/dwarf/

msys: (download the latest and extract the msys folder to c:\mingw32)

http://sourceforge.net/projects/mingwbu ... -packages/

CMake:

http://www.cmake.org/files/v3.0/cmake-3 ... 32-x86.exe

3) Download libraries in MSYS

Open MSYS(click msys.bat in the msys folder), where you'll be in a home directory. Now enter:

Code: Select all

mkdir src
cd src
wget http://www.lua.org/ftp/lua-5.1.5.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
wget http://www.sqlite.org/2013/sqlite-autoconf-3071700.tar.gz
wget http://www.nih.at/libzip/libzip-0.11.2.tar.gz
Manually download the below files from a browser.

Boost: Copy the 'boost' folder from inside the downloaded .tar.gz file to c:\mingw32\include\
https://sourceforge.net/projects/boost/ ... z/download

Hunspell: Copy this file to c:\mingw32\msys\home\your_name\src
http://downloads.sourceforge.net/hunspe ... 3.2.tar.gz

Yajl: Copy this file to c:\mingw32\msys\home\your_name\src
http://github.com/lloyd/yajl/tarball/2.0.1


Zziplib: Extract this to c:\mingw32\msys\home\your_name\src
https://sourceforge.net/projects/zzipli ... 2/download


In the msys window, to extract all the downloaded files enter:

Code: Select all

tar -zxvf hunspell-1.3.2.tar.gz
tar -zxvf lua-5.1.5.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
tar -zxvf libzip-0.11.2.tar.gz
tar -zxvf pcre-8.38.tar.gz
tar -zxvf zziplib-0.13.62
tar -zxvf lloyd-yajl-2.0.1-0-gf4b2b1a.tar.gz
tar -zxvf sqlite-autoconf-3071700.tar.gz
After completing, type 'rm -f *.tar.gz' to cleanup and remove the files that have just been extracted.

4) MSYS Compilations

All these will be compiled inside the msys command prompt. 'cd dirname' into each respective directory:

hunspell-1.3.2:
./configure --prefix=/c/mingw32
You'll get an error in localname.c if you make right away, edit this file (intl/localename.c, comment out case SUBLANG_SINDHI_PAKISTAN: return "sd_PK";)
make && make install

lloyd-yajl-f4b2b1a:
Edit CMakeLists.txt in the base dir of YAJL, and make the following changes:
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") to SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
SET(linkFlags "/PDB:NONE /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF") to SET(linkFlags)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /wd4255 /wd4130 /wd4100 /wd4711") to SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
SET(CMAKE_C_FLAGS_DEBUG "/D DEBUG /Od /Z7") to SET(CMAKE_C_FLAGS_DEBUG "-g")
SET(CMAKE_C_FLAGS_RELEASE "/D NDEBUG /O2") to SET(CMAKE_C_FLAGS_RELEASE "-O2")
And then compile:

Code: Select all

mkdir build
cd build
cmake -G "MSYS Makefiles" ..
make
cp yajl-2.0.1/lib/* /c/mingw32/lib/
cp -R yajl-2.0.1/include/* /c/mingw32/include/
lua-5.1.5:
edit the Makefile, change INSTALL_TOP= /usr/local to INSTALL_TOP= /c/mingw32
change TO_LIB= liblua.a to TO_LIB= liblua.a lua51.dll
make mingw
make install

pcre-8.38:

Code: Select all

./configure --prefix=/c/mingw32 && make && make install
sqlite-autoconf-3071700:

Code: Select all

./configure --prefix=/c/mingw32 && make && make install

zlib-1.2.8:

Code: Select all

make -f win32/Makefile.gcc
export INCLUDE_PATH=/c/mingw32/include/
export LIBRARY_PATH=/c/mingw32/lib/
export BINARY_PATH=/c/mingw32/bin/
make -f win32/Makefile.gcc install
cp zlib1.dll /c/mingw32/bin
cp libz.dll.a /c/mingw32/lib
libzip-0.11.2:

Code: Select all

./configure --prefix=/c/mingw32 && make && make install
cp lib/zipconf.h /c/mingw32/include
zziplib-0.13.62:

Edit the configure file, and change the two occurances of 'uname -msr' to 'uname -ms'

Code: Select all

configure --disable-mmap --prefix=c:/mingw32/ && make && make install
5) Downloading mudlet source

Change back to the src directory with all the downloaded packages.

(note! The git information i'm using doesn't directly target release 30 - comments?)

git clone https://github.com/Mudlet/Mudlet.git

( I will build a commit to change the below information at the source)

edit Mudlet/src/src.pro

to Win32:LIBS:
change:
-lzlib to -lzlib1
-lhunspell to -lhunspell-1.3-0
-lpcre to -lpcre-1
-llibzip to -llibzip-2
add right above -llua51:
-L"C:\\mingw32\\bin" \

6) Build mudlet

cd Mudlet/src

The below will generate warnings: Qt: Untested Windows version 10.0 detected!

qmake
make

That's where it breaks on Qt 5.6 (lack of opengl) - These instructions, however, are using 5.4.2

mkdir /c/release
cp release/mudlet.exe /c/release

7) Copy Needed DLLs to release directory

DLLs found in Qt\Qt5.4.2\5.4\mingw491_32\bin, c:\mingw32\lib and c:\mingw32\bin

Code: Select all

cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/icudt53.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/icuin53.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/icuuc53.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/Qt5Core.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/Qt5Gui.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/Qt5Network.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/Qt5OpenGL.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/Qt5Widgets.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/Qt5Multimedia.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/libgcc_s_dw2-1.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/libstdc++-6.dll /c/release
cp /c/Qt/Qt5.4.2/5.4/mingw491_32/bin/libwinpthread-1.dll /c/release
cp /c/mingw32/lib/libyajl.dll /c/release
cp /c/mingw32/lib/lua51.dll /c/release
cp /c/mingw32/bin/libzip-2.dll /c/release
cp /c/mingw32/bin/libhunspell-1.3-0.dll /c/release
cp /c/mingw32/bin/libpcre-1.dll /c/release
cp /c/mingw32/bin/libsqlite3-0.dll /c/release
cp /c/mingw32/bin/zlib1.dll /c/release
From Qt\Qt5.4.2\5.4\mingw491_32\plugins

audio
mediaservice
platforms

From the Mudlet src directory, copy the mudlet-lua folder and en_US.dic into the release directory

8) LUA

Luarocks:

Download and extract:
http://keplerproject.github.io/luarocks ... -win32.zip

From the directory extracted to,

install.bat /P c:\LuaRocks /MW

Edit \LuaRocks\lua\luarocks\cfg.lua changing mingw32-gcc to gcc (2 occurances)

Code: Select all

cd \LuaRocks
luarocks install LuaFileSystem
luarocks install LuaSQL-SQLite3 SQLITE_INCDIR="c:\mingw32\include" SQLITE_LIBDIR="c:\mingw32\lib"
luarocks install lrexlib-pcre PCRE_LIBDIR="c:\mingw32\lib" PCRE_INCDIR="c:\mingw32\include"
LuaZip:
Download and extract LuaZip:
https://github.com/rjpcomputing/luazip/ ... master.zip

Code: Select all

gcc -O2 -c -o src/luazip.o -IC:/mingw32/include/ src/luazip.c 
gcc -shared -o zip.dll src/luazip.o -Lc:\mingw32\lib -lzzip -lz c:/mingw32/lib/lua51.dll -lm
cp zip.dll /c/release
Copy the contents of c:\mingw32\lib\lua\5.1 to the release folder
lfs.dll
<dir> luasql
rex_pcre.dll


Errors from use of Qt 5.5+

From a bit of research, gluPerspective was removed from GLU (the OpenGL helper library) at version 3.1 - Is linux perhaps linking against an older nonqt opengl library because of functions that were removed? In appears there was a major change to the way Qt supported opengl on windows from 5.5+, the last version i'm likely to be able to compile with without locating external libraries or other changes is 5.4.2

You need to specify an opengl version with Qt5.5+. I added -lopengl32 to LIBS+. There's still link errors, but not pages of them.

./release/glwidget.o:glwidget.cpp:(.text+0x22d): undefined reference to `gluOrtho2D@32'
./release/glwidget.o:glwidget.cpp:(.text+0x283): undefined reference to `gluPerspective@32'
./release/glwidget.o:glwidget.cpp:(.text+0x812): undefined reference to `gluPickMatrix@36'
./release/glwidget.o:glwidget.cpp:(.text+0x864): undefined reference to `gluPerspective@32'
./release/glwidget.o:glwidget.cpp:(.text+0x9b2): undefined reference to `gluPerspective@32'
./release/glwidget.o:glwidget.cpp:(.text+0x1f2f): undefined reference to `gluLookAt@72'
./release/glwidget.o:glwidget.cpp:(.text+0x2817): undefined reference to `gluLookAt@72'
./release/glwidget.o:glwidget.cpp:(.text+0x2ff4): undefined reference to `gluLookAt@72'
./release/glwidget.o:glwidget.cpp:(.text+0x3980): undefined reference to `gluLookAt@72'
./release/glwidget.o:glwidget.cpp:(.text+0x4d13): undefined reference to `gluLookAt@72'
Last edited by Nyyrazzilyss on Fri May 06, 2016 8:50 pm, edited 20 times in total.

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Win10 / Qt 5.4.2 Build

Post by SlySven »

That is a useful post. According to the Wikipedia item I linked to before either in here or another recent thread, {List of Qt Releases}, the way that the Windows version handles Open GL has changed, specifically:
  • 5.4 (10 December 2014) - Dynamic GL switching between graphic backends on Windows (ANGLE or OpenGL)
  • 5.5 (1 July 2015) - On Windows, there will be no more OpenGL-only or ANGLE-only builds and Qt will manage this dynamically
I dunno how this needs to handled but I bet it is relevant! ;)

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Win10 / Qt 5.4.2 Build

Post by Nyyrazzilyss »

The above instructions should be complete now. I will put some effort into cleaning them up a bit/ assembling them into a pasteable script, and see about replacing editing of makefiles/etc with sed commands.

I should be able to go back to looking at 5.6 and opengl now.

Oh - When it compiled, it did show 3.0-dev. I'd used:

git clone https://github.com/Mudlet/Mudlet.git

Is there a subsequent command I should be sending, or that command changed if I want to to be retrieving release 30 (or both)? I'd much rather it was compiling r30. Oh yeah - It'd be nice if it actually showed something other then dev or delta after being compiled :)

I believe you didn't have a windows machine - Virtualbox does run under linux also, so the instructions should work for yourself.

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Win10 / Qt 5.4.2 Build

Post by SlySven »

My main machine is a Dual boot Debian Linux (Wheezy) / Windows 7 - I have a couple of months left to get the 'Doze 10 update in but I rarely switch from the Linux OS as I just prefer it...!

If you have got a git clone of our repositories you just want to use the command line git branch command to change the version of the code you are working on - or you can use what I do, use the very useful gitk which is a GUI that can display the entire development tree and how each revision evolved; then you can create a local copy of the code at pretty much any point and "checkout" a local copy (by right clicking on the plain text that is from the top line of a commit) and "create new branch" which will appear as a (colored) item to the left of the commit details. You can also track other related public repositories - look at the git remote command to set those up - or see later on for a short-cut you might like to take.
gitk_sample.png
To change things (to create a new commit) you then can use various git commands but the simplest is the GUI called, unsurprisingly git gui which allows you to assemble (or "stage") the wanted changes that you make to the "current" branch's "tracked" files (you can select the modifications on a hunk or line by line basis after selecting each file that you want to consider) and add those changes to what will go into the commit, then when you are happy you have everything you can "commit" then (after optionally you have "signed-off" on them) and then "push" them to a remote repository that you have write access to...
git_gui_sample.png
To save you time in setting up the other remote branches you can use a quick and dirty hack to add some of the following to the "config" file in the ".git" subdirectory to your existing file being careful not to replace the one that you will already have for the main Mudlet repository at "url = https://github.com/Mudlet/Mudlet.git":

Code: Select all

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git://git.code.sf.net/p/mudlet/code
[branch "master"]
	remote = origin
	merge = refs/heads/master
[remote "ghMudlet"]
	url = https://github.com/Mudlet/Mudlet.git
	fetch = +refs/heads/*:refs/remotes/ghMudlet/*
[remote "ghSlySven"]
	url = https://github.com/SlySven/Mudlet.git
	fetch = +refs/heads/*:refs/remotes/ghSlySven/*
[remote "ghSlySven2"]
	url = https://github.com/SlySven/Mudlet2.git
	fetch = +refs/heads/*:refs/remotes/ghSlySven2/*
[remote "ghChris"]
	url = https://github.com/Chris7/Mudlet.git
	fetch = +refs/heads/*:refs/remotes/ghChris/*
[remote "ghChris2"]
	url = https://github.com/Chris7/Mudlet2.git
	fetch = +refs/heads/*:refs/remotes/ghChris2/*
[remote "ghVadi"]
	url = https://github.com/vadi2/Mudlet.git
	fetch = +refs/heads/*:refs/remotes/ghVadi/*
[remote "ghLucian"]
	url = https://github.com/lucianposton/Mudlet.git
	fetch = +refs/heads/*:refs/remotes/ghLucian/*
[remote "ghEldFitheach"]
	url = https://github.com/EldFitheach/Mudlet.git
	fetch = +refs/heads/*:refs/remotes/ghEldFitheach/*
[remote "mudlet-lua"]
	url = https://github.com/Vadi2/Mudlet-lua.git
	fetch = +refs/heads/*:refs/remotes/mudlet-lua/*
# Example of a repository located on a backup machine "picard.local" on my LAN which
# has an other wise unused user called "git" - edit to meet your own needs
#[remote "local"]
#	url = git@picard.local:mudlet
#	fetch = +refs/heads/*:refs/remotes/local/*
Once the wanted remote repos have been added you just need a git fetch --all to get the content from all of the remotes and then use the "refresh" or more probably "reload" the display that gitk provides.

In this list (which has been edited from what I am actually using!) you can see:
  • obviously my public ones (which I call "ghMine" and "ghMine2" locally - renamed to "ghSlySven" and "ghSlySven2" in the "config" data above) to which I push my public changes (only the first one nowadays).
  • The main github repository "ghMudlet" - though I have got write access I do not use it from my home machines.
  • Chris's number 1 and number 2 ("ghChris" and "glChris2" and the fact that he had two repos that I was both tracking is why I have two as well).
  • Vadim's "ghVadi" (and his separate "mudlet-lua" repo)
  • A couple of other recent contributor's
  • The original Sourceforge "origin" which has been largely unchanged since 2.1 (only Heko has write access to that I believe) but it is useful for historical purposes going back to the start of Mudlet swithing to using Git.
  • A "local" mirror repository {only has the ".git" subdirectory and the repository data therein, no "working" directory or set of files that can be "edited"} on a backup machine on my home LAN (also my IPv6 gateway) - the reason for that is that I have multiple PCs that I write code on (I can't lug my main PC with its multiple monitors out into the garden) and I do occasionally run parallel development or do operational comparisons in two different branches checked out in two different directories on one machine and a separate repository is the easiest way to transfer changes between two separate local repos (as long as they are kept in sync) as well as providing some protection against hardware failure without pushing EVERYTHING to the PUBLIC (free) github server.
One thing to be aware of is that the two programmes closely interact, (indeed each can be run from the other) and that "staged" but not "committed" changes (show against the "green" dot in the gitk graph/tree) and "unstaged" changes (not present in the sample output about, but shown against a "red" dot in the graph/tree) will probably not persist if you choose to change branch - though it is possible to "create new branch" with out affecting things. It is also possible to revise the last commit at the tip of any branch (use "Amand Last Commit") in git gui but you should really do that only if you haven't pushed the commit beyond the local working copy. It is also possible to revise a sequence of commits going back to a previous point in time (with "git rebase --interactive") but again you should only do that on local commits that have not been pushed out to a public place. If you look at the gitk output you can see that I have a really rag-tag set of commits in my current working branch (which is shown in bold in the tree to show it is the active branch) which I will definitely be cleaning up before I show them to anyone else!

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Win10 / Qt 5.4.2 Build

Post by Vadi »

I got the compile working with Qt 5.6.1. I'll clean up instructions on the wiki so they're repeatable, and and create a pull request with the code changes necessary for 5.6.1.

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Win10 / Qt 5.4.2 Build

Post by SlySven »

If you get anywhere near main.cpp you can probably fix bug 1375449 by making the Doze code the same as the other OSs as far as using '-' and NOT '/' as the argument introducer - having never got a working Doze build platform operating I've not been able to debug the stuff I did there (but I'm looking forward to trying).

Is Qt5.6.1 the only option at present (I see that 5.6 is a Long Term Support version - to be maintained until March 2019 so that is a good one to target)? I'm using 5.7.0 on Linux (AMD64) at present and I think they are already have an 5.8 RC. I suppose also that the 5.6 is only 32-bit on Windows isn't it?

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Win10 / Qt 5.4.2 Build

Post by Vadi »

Not going to look at fixing the bug, just want to get the installer working (gotta stay focused!). I don't mind trying the build with 5.7.0.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Win10 / Qt 5.4.2 Build

Post by Nyyrazzilyss »

Thanks!

I'd sortof left this + mostly been spending time the last couple months changing my script to take advantage of what it could do with the compiled mudlet vs delta.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Win10 / Qt 5.4.2 Build

Post by Vadi »

Qt 5.7 did not work, so I'll keep the instructions on 5.6.

Code: Select all

C:/Qt/5.7/mingw53_32/lib/libQt5UiTools.a(quiloader.o):quiloader.cpp:(.text+0x6e1): undefined reference to `operator delete(void*, unsigned int)'
C:/Qt/5.7/mingw53_32/lib/libQt5UiTools.a(quiloader.o):quiloader.cpp:(.text+0x751): undefined reference to `operator delete(void*, unsigned int)'
C:/Qt/5.7/mingw53_32/lib/libQt5UiTools.a(quiloader.o):quiloader.cpp:(.text+0x769): undefined reference to `operator delete(void*, unsigned int)'
c:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.1/../../../../i686-w64-mingw32/bin/ld.exe: C:/Qt/5.7/mingw53_32/lib/libQt5UiTools.a(quiloader.o): bad reloc address 0x4 in section `.data'

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Win10 / Qt 5.4.2 Build

Post by Vadi »

Many hours later and 4 complete re-runs of the instructions, the instructions for Qt 5.6 are now up to date: http://wiki.mudlet.org/w/Compiling_Mudl ... Windows_10

I've also improved the instructions and made a lot of things copy/pasteable, which makes the process quicker and less painful. Thanks to Nyyrazzilyss for solving a bunch of problems here earlier in the year.

If anyone could try the instructions out themselves to confirm that they work, that'd be great.

Post Reply