User Tools

Site Tools


tutorials:compiling_orx_with_mingw32_gmake

Compiling Orx with mingw32/gmake on Windows

Note: when cloning orx and running it's accompanying setup file, a windows gmake build project is automatically created. These instructions will help you do this manually if you ever need to remake your own.

There are 5 steps required to build Orx using gmake

  1. Getting Orx from source
  2. Getting mingw32 (not mingw64)
  3. Updating the PATH environment variable
  4. Creating a build project for gmake
  5. Compiling

Getting Orx from source

This step is already covered under cloning orx. Please follow those instructions first.

Getting mingw32

Orx works with mingw32. Do not download the mingw64 project. Orx does not support this compiler yet. You can download an installer from: https://sourceforge.net/projects/mingw/files/Installer/ You will want the mingw-get-setup.exe file.

  1. Run the mingw-get-setup.exe file.
  2. Choose an installation directory. To avoid dramas, don't choose a folder with spaces in it. Something like C:\MinGW is best.
  3. Turn off the “start menu” and “on the desktop” options.
  4. Continue
  5. The application will download xml catalogues for a minute or two.
  6. Continue
  7. Under basic setup, choose mingw32-base and mingw32-gcc-g++.
  8. Select the Installation menu / Apply Changes.
  9. The compiler will be installed into the folder you chose.

Updating the PATH environment variable

  1. Edit the System Environment Variables
  2. Add your mingw bin folder location into the PATH list, ie: C:\MinGW\bin or C:\MinGW-5.3.0\bin (depending where you installed it)

Creating a build project for gmake

  1. Open a command window (cmd.exe)
  2. cd into the C:\[somewhere]\orx\code\build folder
  3. premake4.exe gmake

Expected output:

Building configurations...
Running action 'gmake'...
Generating windows/gmake/Makefile...
Generating windows/gmake/orx.make...
Generating windows/gmake/orxLIB.make...
Generating windows/gmake/Bounce.make...
Done.

Compiling

  1. cd into the gmake folder
  2. mingw32-make

Expected output

"==== Building orxLIB (debug) ===="
Creating ../../../lib/dynamic
Creating obj/Debug/orxLIB
orxPlugin_EmbeddedList.cpp
orxAnim.c
orxAnimPointer.c
orxAnimSet.c
orxModule.c
orxType.c
orxClock.c
orxCommand.c
orxConfig.c
orxConsole.c
orxEvent.c
orxLocale.c
orxResource.c
orxSystem.c
orxThread.c
orxDebug.c
orxFPS.c
orxProfiler.c
orxDisplay.c
orxFont.c
orxGraphic.c
orxScreenshot.c
orxText.c
orxTexture.c
orxFile.c
orxInput.c
orxJoystick.c
orxKeyboard.c
orxMouse.c
orxParam.c
orxMath.c
orxVector.c
orxBank.c
orxMemory.c
orxFrame.c
orxFX.c
orxFXPointer.c
orxObject.c
orxSpawner.c
orxStructure.c
orxTimeLine.c
orxBody.c
orxPhysics.c
orxPlugin.c
orxCamera.c
orxRender.c
orxShader.c
orxShaderPointer.c
orxViewport.c
orxSound.c
orxSoundPointer.c
orxSoundSystem.c
orxHashTable.c
orxLinkList.c
orxString.c
orxTree.c
Linking orxLIB
Running post-build commands
cmd /c copy /Y ..\..\..\lib\dynamic\orx*.dll ..\..\..\bin
..\..\..\lib\dynamic\orxd.dll
        1 file(s) copied.
"==== Building orx (debug) ===="
Creating obj/Debug/orx
orxMain.c
Linking orx
"==== Building Bounce (debug) ===="
Creating ../../../bin/plugins/demo
Creating obj/Debug/Bounce
orxBounce.c
Linking Bounce

Your Orx Library

If you check in the C:\[somewhere]\orx\code\lib\dynamic folder, you'll see an liborxd.a and orxd.dll

Profile and Release builds

If you wish to build the other configurations, you can do so with:

mingw32.make config=profile

and…

mingw32.make config=release

… respectively.

Troubleshooting

When using mingw32-make to build the project, and you receive the following:

==== Building orxLIB (debug) ====
sh: C:\Program: No such file or directory
orxLIB.make:247: recipe for target 'obj/Debug/orxLIB' failed
mingw32-make[1]: *** [obj/Debug/orxLIB] Error 127
Makefile:20: recipe for target 'orxLIB' failed
mingw32-make: *** [orxLIB] Error 2

Trying:

mingw32-make -d

Will give you more info, and you'll likely see the culprit as:

find_and_set_shell() path search set default_shell = C:/Program Files (x86)/Git/bin/sh.exe

It is likely to be caused another shell like bash, or git-bash installed in your system. Your path environment variable will contain an entry pointing to the bin folder of another shell. This will cause issues. Check your System Environment Variables in Windows.

If you find an entry in your path variable like: 'C:\Program Files (x86)\Git\bin'

Delete this reference, start a new command prompt and try again.

tutorials/compiling_orx_with_mingw32_gmake.txt · Last modified: 2017/09/20 06:58 (4 weeks ago) by sausage