Changes for windows compilation (SDL-Only)#10
Open
andychase wants to merge 1 commit intosinamas:masterfrom
andychase:windows-compile-sdl
Open
Changes for windows compilation (SDL-Only)#10andychase wants to merge 1 commit intosinamas:masterfrom andychase:windows-compile-sdl
andychase wants to merge 1 commit intosinamas:masterfrom
andychase:windows-compile-sdl
Conversation
Windows is a special monkey and needs some assistance in compilation. These changes are for the standard VC2015 compilation not through CYGWIN and MINGW which may not need these changes. This fixes the build for SDL. The QT version might need more changes. Other version information: * Windows 10 SDK * x64 Native Compilation (64-bit) * VC2015 * SCONS v2.4.1 * SDL 1.2.15 Changes implementented: * Define `-DNOMINMAX` * This solves issues with Windows.h clobbering the STD::MIN, STD::MAX macros with their own and causing many obscure syntax errors during compilation. * Add `-SUBSYSTEM:CONSOLE` to linker options * Fixes error message: `LINK : fatal error LNK1561: entry point must be defined` * Source: http://stackoverflow.com/a/28256749 * Remove `env.ParseConfig('sdl-config')` * This utility script isn't available on windows. * Replace with the direct path to the libs and headers * SDL libs can be downloaded here: https://www.libsdl.org/download-1.2.php (SDL-devel-1.2.15-VC.zip (Visual C++) is needed) * Since Windows doesn't have a standard method for detecting header/lib paths, the paths were set manually to "C:\Program Files (x86)\SDL-1.2.15\include", etc. * Remove '-Wextra' under windows * This isn't defined in the Windows compiler. * Note that '-Wall' compilation is very slow. Perhaps consider removing this under windows also. * Add `#include <algorithm>` to `cartridge.cpp` * This adds a few macros needed to compile * Move `-DHAVE_STDINT_H` to the global compiler flags. The previous way of doing this caused linker issues (specifically 3 functions wouldn't link correctly). * Add `#undef main` in `gambatte_sdl.cpp`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows is a special monkey and needs some assistance in compilation. These changes are for the standard VC2015 compilation not through CYGWIN and MINGW which may not need these changes.
This fixes the build for SDL. The QT version might need more changes.
Other version information:
Changes implementented:
-DNOMINMAX-SUBSYSTEM:CONSOLEto linker optionsLINK : fatal error LNK1561: entry point must be definedenv.ParseConfig('sdl-config')#include <algorithm>tocartridge.cpp-DHAVE_STDINT_Hto the global compiler flags. The previous way of doing this caused linker issues (specifically 3 functions wouldn't link correctly).#undef mainingambatte_sdl.cpp