How to build wxLauncher with Eclipse, MinGW-W64 on Windows 10

This assumes that that you have Eclipse and MinGW-W64 already set up.

Download CMake.

Download wxWidgets from https://wxwidgets.org/downloads/.  Currently, the wxLauncher project uses v3.1.0, which is not the stable version.  After installing it, create a new environment variable named WXWIN pointing to the wxWidgets root directory.

Then you will need to compile it.

Open the Command Prompt and type “cd %WXWIN%\build\msw”.

Then type “mingw32-make -f makefile.gcc”.

After that’s finished (it will take a while), type “mingw32-make -f makefile.gcc BUILD=release”.

Download Python from https://www.python.org/downloads/windows/.  Either Python 2.7 or Python 3 is fine.

Make sure that Python has been added to your Path variable.

Download Python Markdown from https://pypi.python.org/pypi/Markdown.

Extract the files (you will need 7-Zip or some other extractor program).  Open the directory where you extracted the files, click on the File tab and open the command line.

Type “python setup.py install” and wait for it to finish.

Download and install the OpenAL SDK from https://www.openal.org/downloads/.

Lastly, you might need to install NSIS.  Download and install from http://nsis.sourceforge.net/Main%5FPage

Add the “x86_64-w64-mingw32\lib” subdirectory of your MinGW-W64 installation as an environment variable.  For me, it was C:\Program Files\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev0\mingw64\x86_64-w64-mingw32\lib\.

Then open up CMakeLists.txt and look for the following line:  target_link_libraries(wxlauncher ${wxWidgets_LIBRARIES} ${SDL2_LIBRARIES})

Above that, add

find_library(SHLWAPI libshlwapi.a)
find_library(MINCORE libversion.a)

Then replace the “target_link_libraries” line with

target_link_libraries(wxlauncher ${wxWidgets_LIBRARIES} ${MINCORE})
target_link_libraries(wxlauncher ${wxWidgets_LIBRARIES} ${SHLWAPI})
target_link_libraries(wxlauncher ${SDL2_LIBRARIES} ${MINCORE})
target_link_libraries(wxlauncher ${SDL2_LIBRARIES} ${SHLWAPI})
target_link_libraries(wxlauncher ${wxWidgets_LIBRARIES} ${SDL2_LIBRARIES})

Run CMake and fill the SHLWAPI variable with something like the following (it will depend on your version of GCC):  “C:\\Program\ Files\\mingw-w64\\x86_64-7.1.0-posix-seh-rt_v5-rev0\\mingw64\\x86_64-w64-mingw32\\lib\\libshlwapi.a” and MINCORE with C:\\Program\ Files\\mingw-w64\\x86_64-7.1.0-posix-seh-rt_v5-rev0\\mingw64\\x86_64-w64-mingw32\\lib\\libversion.a.

Replace the CMAKE_INSTALL_PREFIX value with the directory where you want wxLauncher to be built.

Import the project into Eclipse and build the Install target.  Then go into the folder you specified for CMAKE_INSTALL_PREFIX and drill down into the bin subfolder, where you will find the executable.

To actually run the game, I found that you must use an FSO later than 3.7.4, or a registry error will prevent you from launching the game.  Also, you might encounter some errors, which can simply be clicked through.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s