Compiling Minetest on Windows

User avatar
Enrikoo
Member
 
Posts: 417
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko

Compiling Minetest on Windows

by Enrikoo » Wed Dec 20, 2017 15:23

I don't know how to compile a minetest client on windows 10, i tried to compile but i have not any tools to work now.
Does someone compiling on windows and how long you need to compile on windows?
 

trainwrecktony
Member
 
Posts: 59
Joined: Sun Jun 08, 2014 05:24
Location: NJ USA
In-game: trainwrecktony

Re: Compiling Minetest on Windows

by trainwrecktony » Wed Dec 20, 2017 16:53

http://dev.minetest.net/Compiling_Minet ... on_Windows

I used cygwin with its mingw to crosscompile. i previously used to build pidgin and its plugins for windows so it was familiar to me and i also use its ssh server for double secure rdp and proxy to my server remotely. i forget all the packages required but for 64bit you'll need like mingw64-x86_64 binutils libpng libjpeg libvorbis etc. There were some issues with the early mingw-gcc6 releases on cygwin so its been a while and i moved to cross compling on arch-linux which has a newer mingw-gcc7. Crosscompiling on linux will be similar you'll be using whatever version on mingw from that distro. you might be able to use the ubunutu based linux on windows10 feature to also crosscompile

clone minetest from git if building 64bit edit the toolchain_mingw64.cmake to set compliers. i find it easiest to edit files with notepad++ on windows you'll need to edit the file to match this

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)

run the buildwin64.sh in /util/buildbot it will pull down support libs. you may need to edit the paths in buildwin64.sh before/after and may need to rerun the cygwin install if any missing support dev libraries

once you get that all ironed out it if built successful will dump a zip install into the _build folder. you can extract that to wherever but will need to copy some dlls from your cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin folder to your minetest\bin folder. i believe libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll . You'll get errors if they're missing from your minetest\bin folder. If/when cygwin has mingw updates you'll need to copy the updated dll's from cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin to your minetest\bin folder again.

once you get your building environment set then updating is just running the buildwin64.sh script it'll pull down latest minetest and minetest game git and build
Server Owner trainwrecktony.serveminecraft.net:30000
Server Specs: i5-3570, 16gb, 1tb 7200rpm 64mb cache, Win 2012 r2 x64, Dev mingw x64 minetest build, redis db
Gaming: Clevo W150HNQ, i7-2820, 16gb 1866 hyperx, 256gb Samsung 840 PRO SSD, Nvidia GT 540M, Win 7 Pro x64, Dev mingw x64 minetest build
 

User avatar
Enrikoo
Member
 
Posts: 417
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko

Re: Compiling Minetest on Windows

by Enrikoo » Wed Dec 20, 2017 17:09

trainwrecktony wrote:http://dev.minetest.net/Compiling_Minetest#Compiling_on_Windows

I used cygwin with its mingw to crosscompile. i previously used to build pidgin and its plugins for windows so it was familiar to me and i also use its ssh server for double secure rdp and proxy to my server remotely. i forget all the packages required but for 64bit you'll need like mingw64-x86_64 binutils libpng libjpeg libvorbis etc. There were some issues with the early mingw-gcc6 releases on cygwin so its been a while and i moved to cross compling on arch-linux which has a newer mingw-gcc7. Crosscompiling on linux will be similar you'll be using whatever version on mingw from that distro. you might be able to use the ubunutu based linux on windows10 feature to also crosscompile

clone minetest from git if building 64bit edit the toolchain_mingw64.cmake to set compliers. i find it easiest to edit files with notepad++ on windows you'll need to edit the file to match this

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)

run the buildwin64.sh in /util/buildbot it will pull down support libs. you may need to edit the paths in buildwin64.sh before/after and may need to rerun the cygwin install if any missing support dev libraries

once you get that all ironed out it if built successful will dump a zip install into the _build folder. you can extract that to wherever but will need to copy some dlls from your cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin folder to your minetest\bin folder. i believe libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll . You'll get errors if they're missing from your minetest\bin folder. If/when cygwin has mingw updates you'll need to copy the updated dll's from cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin to your minetest\bin folder again.

once you get your building environment set then updating is just running the buildwin64.sh script it'll pull down latest minetest and minetest game git and build

How to use CMAKE and where i can open it?
 

User avatar
srifqi
Member
 
Posts: 553
Joined: Sat Jun 28, 2014 04:31
Location: Indonesia
GitHub: srifqi
IRC: srifqi
In-game: srifqi

Re: Compiling Minetest on Windows

by srifqi » Mon Dec 25, 2017 04:59

You can download CMake from their website. Install it. It should shows up in Start Menu if you use default option.
I'm from Indonesia! Saya dari Indonesia!
Terjemahkan Minetest!
Mods by me. Modifikasi oleh saya.

Pronounce my nick as in: es-rifqi (IPA: /es rifˈki/)
 

User avatar
Enrikoo
Member
 
Posts: 417
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko

Re: Compiling Minetest on Windows

by Enrikoo » Mon Dec 25, 2017 10:37

Oops i downloaded a cmake source code i need to download the stable cmake. What is the source code you selected and build what you selected?
 

User avatar
Enrikoo
Member
 
Posts: 417
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko

Re: Compiling Minetest on Windows

by Enrikoo » Mon Dec 25, 2017 18:34

I don't know where is a directory, i tried this
Attachments
Error.png
(24.89 KiB) Not downloaded yet
 

User avatar
srifqi
Member
 
Posts: 553
Joined: Sat Jun 28, 2014 04:31
Location: Indonesia
GitHub: srifqi
IRC: srifqi
In-game: srifqi

Re: Compiling Minetest on Windows

by srifqi » Tue Dec 26, 2017 04:30

Notice: You can read this article if you still don't understand.

After you install CMake. You have to get Minetest source code. You can download from any branch (e.g. master), stable branches (e.g. stable-0.4), or version specific (e.g. 0.4.16).

After that, you extract that zipped folder into a folder, for example: minetest (C:\minetest\minetest). Then, create new folder to place some files required for compiling process, for example: mtbuild (C:\minetest\mtbuild).

Download libraries required to compile Minetest. (Read here.) Place those in another folder, for example: mtlibs (C:\minetest\mtlibs).

Open CMake. Set your source code location to your minetest folder (C:\minetest\minetest\). Set your build location to your mtbuild folder (C:\minetest\mtbuild\).

Click Configure.

Set the configuration to be like this:
Code: Select all
   BUILD_CLIENT               [X]
   BUILD_SERVER               [ ]
   CMAKE_BUILD_TYPE           Release
   CMAKE_INSTALL_PREFIX       DIR/minetest-install
   RUN_IN_PLACE               [X]
   WARN_ALL                   [ ]
   GETTEXT_BIN_DIR            DIR/gettext/bin
   GETTEXT_INCLUDE_DIR        DIR/gettext/include
   GETTEXT_LIBRARIES          DIR/gettext/lib/libintl.lib
   IRRLICHT_SOURCE_DIR        DIR/irrlicht-1.8.1
   IRRLICHT_LIBRARY           DIR/irrlicht-1.8.1/lib/?/Irrlicht.lib
   OGG_INCLUDE_DIR            DIR/libogg-1.3.1/include
   OGG_LIBRARIES              DIR/libogg-1.3.1/?/libogg.lib
   VORBIS_INCLUDE_DIR         DIR/libvorbis-1.3.3/include
   VORBIS_LIBRARY             DIR/libvorbis-1.3.3/?/libvorbis.lib
   VORBISFILE_INCLUDE_DIR     DIR/libvorbis-1.3.3/include
   VORBISFILE_LIBRARY         DIR/libvorbis-1.3.3/?/libvorbisfile.lib
   OPENAL_INCLUDE_DIR         %programfiles%\OpenAL\include
   OPENAL_LIBRARY             %programfiles%\OpenAL\lib\OpenAL32.lib
   ZLIB_DLL                   DIR/zlib125dll/dll32/zlibwapi.dll
   ZLIB_INCLUDE_DIR           DIR/zlib-1.2.5
   ZLIB_LIBRARIES             DIR/zlib125dll/dll32/zlibwapi.lib

where DIR is your mtlibs folder (C:\minetest\mtlibs).

Click Configure again.

Click Generate.

From the article, I quote:
Code: Select all
 If using MSVC:
       - Open the generated minetest.sln
       - Switch the configuration from "Debug" to "Release", unless you want to
       debug some stuff (it's slower and might not even work at all)
       - Build the ALL_BUILD project
       - Build the INSTALL project
       You may want to use console commands to compile Minetest:
           - Find MSBuild.exe in %windir%\Microsoft.NET\Framework\v?.?.?\MSBuild.exe
           - Add the path to your system PATH variable
           - Compile Minetest by switching to your DIR\minetest-build
               MSBuild.exe ALL_BUILD.vcxproj /p:Configuration=Release
       - You should now have a working game with the executable in
           DIR/minetest-install/bin/minetest.exe
       - Additionally you may create a zip package by building the PACKAGE
         project.
   If using MinGW:
       - Using the command line, browse to the build directory and run 'make'
         (or mingw32-make or whatever it happens to be)
       - You may need to copy some of the downloaded DLLs into bin/, see what
         running the produced executable tells you it doesn't have.
       - You should now have a working game with the executable in
           DIR/minetest/bin/minetest.exe


Hope this helps!
I'm from Indonesia! Saya dari Indonesia!
Terjemahkan Minetest!
Mods by me. Modifikasi oleh saya.

Pronounce my nick as in: es-rifqi (IPA: /es rifˈki/)
 

User avatar
srifqi
Member
 
Posts: 553
Joined: Sat Jun 28, 2014 04:31
Location: Indonesia
GitHub: srifqi
IRC: srifqi
In-game: srifqi

Re: Compiling Minetest on Windows

by srifqi » Tue Dec 26, 2017 04:35

Also, you are using Windows 10, right? You can activate Developer Mode to get Windows Subsystem for Linux and then using Bash on Ubuntu on Windows just run buildwin64.sh. :D

*This is what I do to compile Minetest.
I'm from Indonesia! Saya dari Indonesia!
Terjemahkan Minetest!
Mods by me. Modifikasi oleh saya.

Pronounce my nick as in: es-rifqi (IPA: /es rifˈki/)
 

User avatar
Enrikoo
Member
 
Posts: 417
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko
 

User avatar
Enrikoo
Member
 
Posts: 417
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko

Re: Compiling Minetest on Windows

by Enrikoo » Tue Dec 26, 2017 10:23

Post some images as example what you have in your mtlibs folder

Is this a mistake?
Code: Select all
CMAKE_CONFIGURATION_TYPES = Debug;Release;MinSizeRel;RelWithDebInfo


Output error
Code: Select all
Configuring incomplete, errors occurred!
See also "C:/Users/Enrico/Downloads/minetest/mtlibs/CMakeFiles/CMakeOutput.log".


Source code misunderstand.
I haven't a DIR. Post me images as examples.
Doesn't work.

Do i need to download directory or make a directory in mtlibs?
 

User avatar
addi
Member
 
Posts: 658
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

Re: Compiling Minetest on Windows

by addi » Tue Dec 26, 2017 14:12

Some time ago I wrote a build script to download and build Minetest and its dependencies.

I hope this will make your live easier:
viewtopic.php?f=14&t=18558
 

User avatar
Enrikoo
Member
 
Posts: 417
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko
 

User avatar
addi
Member
 
Posts: 658
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

Re: Compiling Minetest on Windows

by addi » Fri Jan 05, 2018 10:27

You does not need it, you can still do it manually, it just saves you a lot of time.
 


Return to Builds



Who is online

Users browsing this forum: No registered users and 3 guests