Recipe to compile Mudlet on Windows

Post Reply
InTheWorks
Posts: 18
Joined: Sat Sep 10, 2011 7:37 am

Recipe to compile Mudlet on Windows

Post by InTheWorks »

I just made a package to compile mudlet on windows available for a limited time download:

ge.tt/7ZiY3fG/v/0?c


The package includes
1. qt 4.7.3 (release dll's only) with mingw
2. a batch script to set variables
3. the headers (only) for all required packages
4. a preconfigured src.pro (this needs to go the mudlet src directory)
5. the install directory (containing precompiled dll's used for linking and runtime) of mudlet 2.0 test 4

Total size unpacked size is 356 MB and compressed with 7zip it's 53 MB. It's a bit of a hack, certainly not the best way, but it's quick and easy. All you'll need to do is provide the sources.

readme.txt says:

Directory structure should look like this:

mudlet_package
|-- includes
|-- mudlet.git
|-- mudlet_libs
|-- QtSDK

where mudlet.git is the directory containing the mudlet sources. Once, mudlet is compiled, copy mudlet.exe to the mudlet_libs directory. Lauch mudlet from within the mudlet_libs directory.

Before running qmake in the src directory of the mudlet sources, go to the mudlet_package directory and run setvars.bat. Then cd to mudlet.git\src and run qmake followed by mingw32-make.

This was tested on Windows XP 32-bit and "Works for me"(tm).

Finally, I just wanted to make a note about what was required to make this package available. To work around "limitations" with the Qt library (I'll be nice and not vent), some patched versions of qmake and friends were required. A kind soul already tackled this problem for visual studio binaries and made them available:

http://qt-windows-binaries.googlecode.c ... wsBinaries

I downloaded the binaries from above and copied out the exe's from the bin directory into my mingw install of the Qt SDK. This will allow the Qt SDK to be used with relative paths - you should be able to move the QtSDK directory anywhere and it will still work. No separate installation of Qt is required (which is how it should be).

I also removed all of the debug dll's from this package simply because they are quite large. If you need to build with the debug versions of the library you probably know what you're doing and don't need this package. I also removed Qt Creator because I imagine the majority of people using this package just want to compile and play with the latest git.

Not all of the dll's contain readily available version numbers so the header versions may not match the dll's linked to. I didn't encounter any problems though. Feedback is welcome.

If you download this, and you're able to compile mudlet, please post back here as I would like to know that it works. If you download this and it doesn't work, please post back here also and I'll try to help you out.

DevArrah
Posts: 51
Joined: Sat Oct 29, 2011 4:57 pm

Re: Recipe to compile Mudlet on Windows

Post by DevArrah »

I'm game for trying this but what kind of compiler do I need to do this? is this for gcc?

InTheWorks
Posts: 18
Joined: Sat Sep 10, 2011 7:37 am

Re: Recipe to compile Mudlet on Windows

Post by InTheWorks »

Everything you need should be in the package, except for the mudlet sources.
Before running qmake in the src directory of the mudlet sources, go to the mudlet_package directory and run setvars.bat. Then cd to mudlet.git\src and run qmake followed by mingw32-make.
Try giving those instructions a try after downloading and unpacking. It should just work, or at least that was the intent.

Oh and to answer your question the necessary compiler is gcc. However, best use the gcc in the download I provided since that one came with the Qt SDK.

DevArrah
Posts: 51
Joined: Sat Oct 29, 2011 4:57 pm

Re: Recipe to compile Mudlet on Windows

Post by DevArrah »

I'll give it a whirl and let you know

DevArrah
Posts: 51
Joined: Sat Oct 29, 2011 4:57 pm

Re: Recipe to compile Mudlet on Windows

Post by DevArrah »

I apologize for being so pokey but I finally tried this and I got the following message:

The program can't start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fix this problem.

I'm not sure what version was needed but i but I downloaded and installed all versions of the c++ redistributable from Microsoft Answers site

It didn't work for me. This was the output (using Win7 SP1 x64)

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\LocalAdmin>cd C:\Users\LocalAdmin\Documents\Dev\mudlet_package\mudlet_p
ackage

C:\Users\LocalAdmin\Documents\Dev\mudlet_package\mudlet_package>setvars.bat
C:\Users\LocalAdmin\Documents\Dev\mudlet_package\mudlet_package>cd mudlet.git/sr
c

C:\Users\LocalAdmin\Documents\Dev\mudlet_package\mudlet_package\mudlet.git\src>q
make
WARNING: c:\Users\LocalAdmin\Documents\Dev\mudlet_package\mudlet_package\mudlet.
git\src\src.pro:27: Unescaped backslashes are deprecated.
WARNING: c:\Users\LocalAdmin\Documents\Dev\mudlet_package\mudlet_package\mudlet.
git\src\src.pro:27: Unescaped backslashes are deprecated.
WARNING: c:\Users\LocalAdmin\Documents\Dev\mudlet_package\mudlet_package\mudlet.
git\src\src.pro:27: Unescaped backslashes are deprecated.
WARNING: fonts.path is not defined: install target not created

WARNING: luaglobal.path is not defined: install target not created

WARNING: documentation.path is not defined: install target not created

WARNING: target.path is not defined: install target not created

WARNING: fonts.path is not defined: install target not created

WARNING: luaglobal.path is not defined: install target not created

WARNING: documentation.path is not defined: install target not created

WARNING: target.path is not defined: install target not created

DevArrah
Posts: 51
Joined: Sat Oct 29, 2011 4:57 pm

Re: Recipe to compile Mudlet on Windows

Post by DevArrah »

Hmmm... can someone suggest what to research to try to get this work? I'd love to be able to compile for windows but i've never really used a not built-into-the-IDE compiler before so any help on what i'd need to know to get up to speed would be appreciated.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Recipe to compile Mudlet on Windows

Post by chris »

I gave this a whirl. Here are the steps I took/modifications needed:
1) download package linked above, extract
2) clone my github repository, copy the Mudlet folder into mudlet_packages, and rename to mudlet.git
3) in mudlet_package/includes/lloyd.../src do the following:
3a) make a copy of yajl, rename to api
3b) edit yajl_parse.h, add #include "yajl_lex.h" after #include "yajl_buf.h"
4) copy src.pro from /mudlet_package to /mudlet_package/mudlet.git/src
5) Make the following changes to src.pro (remember to add a \ to the line above where you insert these)
5a) add luaInterface.cpp and dlgVarsMainArea.cpp at the end of SOURCES
5b) add luaInterface.h and dlgVarsMainArea.h at the end of HEADERS
5c) add ui/vars_main_area.ui to the end of FORMS
6) go into command line, run setvars.bat in /mudlet_package
7) goto mudlet.git/src in command line, type qmake, then mingw32-make (note, the fonts.path, etc warnings don't matter)
8) copy the files in mudlet.git/src/release (the mudlet exe and a source file) to mudlet_libs
9) enjoy

DevArrah
Posts: 51
Joined: Sat Oct 29, 2011 4:57 pm

Re: Recipe to compile Mudlet on Windows

Post by DevArrah »

I finally got around to trying it and it started compiling but eventually i ran into this:
Code: [show] | [select all] lua
C:\Users\LocalAdmin\Documents\Dev\mudlet_package\mudlet_package\QtSDK\4.7.3\bin\
moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_PHONON_LIB
-DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HA
VE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD
_SUPPORT -I"..\..\QtSDK\4.7.3\include\QtUiTools" -I"..\..\QtSDK\4.7.3\include\Qt
Core" -I"..\..\QtSDK\4.7.3\include\QtNetwork" -I"..\..\QtSDK\4.7.3\include\QtGui
" -I"..\..\QtSDK\4.7.3\include\QtOpenGL" -I"..\..\QtSDK\4.7.3\include\QtXml" -I"
..\..\QtSDK\4.7.3\include\phonon" -I"..\..\QtSDK\4.7.3\include" -I"." -I"..\..\i
ncludes\lua-5.1.4\src" -I"..\..\includes\zlib123-dll\include" -I"..\..\includes\
boost_1_47_0" -I"..\..\includes\pcre-8.13" -I"..\..\includes\lloyd-yajl-17b1790\
src" -I"..\..\includes\hunspell-1.3.2\src" -I"irc\include" -I"..\..\QtSDK\4.7.3\
include\ActiveQt" -I"..\..\QtSDK\4.7.3\include\phonon_compat" -I"tmp" -I"." -I".
.\..\QtSDK\4.7.3\mkspecs\win32-g++" -D__GNUC__ -DWIN32 dlgVarsMainArea.h -o tmp\
moc_dlgVarsMainArea.cpp
g++ -c -O2 -O3 -Wno-deprecated -Wno-unused-parameter -frtti -fexceptions -mthrea
ds -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_PHONON_LIB
 -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_H
AVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREA
D_SUPPORT -I"..\..\QtSDK\4.7.3\include\QtUiTools" -I"..\..\QtSDK\4.7.3\include\Q
tCore" -I"..\..\QtSDK\4.7.3\include\QtNetwork" -I"..\..\QtSDK\4.7.3\include\QtGu
i" -I"..\..\QtSDK\4.7.3\include\QtOpenGL" -I"..\..\QtSDK\4.7.3\include\QtXml" -I
"..\..\QtSDK\4.7.3\include\phonon" -I"..\..\QtSDK\4.7.3\include" -I"." -I"..\..\
includes\lua-5.1.4\src" -I"..\..\includes\zlib123-dll\include" -I"..\..\includes
\boost_1_47_0" -I"..\..\includes\pcre-8.13" -I"..\..\includes\lloyd-yajl-17b1790
\src" -I"..\..\includes\hunspell-1.3.2\src" -I"irc\include" -I"..\..\QtSDK\4.7.3
\include\ActiveQt" -I"..\..\QtSDK\4.7.3\include\phonon_compat" -I"tmp" -I"." -I"
..\..\QtSDK\4.7.3\mkspecs\win32-g++" -o tmp\moc_dlgVarsMainArea.o tmp\moc_dlgVar
sMainArea.cpp
c:\Users\LocalAdmin\Documents\Dev\mudlet_package\mudlet_package\QtSDK\4.7.3\bin\
rcc.exe -name mudlet_alpha mudlet_alpha.qrc -o release\qrc_mudlet_alpha.cpp
g++ -c -O2 -O3 -Wno-deprecated -Wno-unused-parameter -frtti -fexceptions -mthrea
ds -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_PHONON_LIB
 -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_H
AVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREA
D_SUPPORT -I"..\..\QtSDK\4.7.3\include\QtUiTools" -I"..\..\QtSDK\4.7.3\include\Q
tCore" -I"..\..\QtSDK\4.7.3\include\QtNetwork" -I"..\..\QtSDK\4.7.3\include\QtGu
i" -I"..\..\QtSDK\4.7.3\include\QtOpenGL" -I"..\..\QtSDK\4.7.3\include\QtXml" -I
"..\..\QtSDK\4.7.3\include\phonon" -I"..\..\QtSDK\4.7.3\include" -I"." -I"..\..\
includes\lua-5.1.4\src" -I"..\..\includes\zlib123-dll\include" -I"..\..\includes
\boost_1_47_0" -I"..\..\includes\pcre-8.13" -I"..\..\includes\lloyd-yajl-17b1790
\src" -I"..\..\includes\hunspell-1.3.2\src" -I"irc\include" -I"..\..\QtSDK\4.7.3
\include\ActiveQt" -I"..\..\QtSDK\4.7.3\include\phonon_compat" -I"tmp" -I"." -I"
..\..\QtSDK\4.7.3\mkspecs\win32-g++" -o tmp\qrc_mudlet_alpha.o release\qrc_mudle
t_alpha.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\mudlet.exe object_scri
pt.mudlet.Release  -L"c:\Users\LocalAdmin\Documents\Dev\mudlet_package\mudlet_pa
ckage\QtSDK\4.7.3\lib" -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -lqtmain -L
..\..\mudlet_libs -llua51 -lpcre -lhunspell -lyajl -lphonon4 -lQtOpenGL4 -lQtNet
work4 -lQtUiTools -LC:\OpenSSL-Win32_full\lib -lQtXml4 -lQtGui4 -lQtCore4
./tmp\mudlet.o:mudlet.cpp:(.text+0x12754): undefined reference to `_imp___ZN8QWe
bViewC1EP7QWidget'
./tmp\mudlet.o:mudlet.cpp:(.text+0x12b06): undefined reference to `_imp___ZN8QWe
bView6setUrlERK4QUrl'
./tmp\mudlet.o:mudlet.cpp:(.text+0x13351): undefined reference to `_imp___ZN8QWe
bView7setHtmlERK7QStringRK4QUrl'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\mudlet.exe] Error 1
mingw32-make[1]: Leaving directory `C:/Users/LocalAdmin/Documents/Dev/mudlet_pac
kage/mudlet_package/mudlet.git/src'
mingw32-make: *** [release] Error 2
any suggestions?

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

Re: Recipe to compile Mudlet on Windows

Post by Vadi »

Try cleaning it and re-doing it... also, what Qt version?

DevArrah
Posts: 51
Joined: Sat Oct 29, 2011 4:57 pm

Re: Recipe to compile Mudlet on Windows

Post by DevArrah »

I apologize in advance for the silly question but how do I clean it? I've never worked with command line compilers (at least directly).

It looks like the QT version is 4.7.3

Post Reply