pixicoder/PS

Compile to Windows, got the command-line

Closed this issue · 1 comments

9912 commented

Hi, i've compiled this source on windows-32bit, but some modifications are needed:

Replacing the line:
#include <unistd.h>

with:

//header swap, using unistd.h in *n*x, 
//windows users will use windows.h with sleep() function overrride
#ifdef __unix__
# include <unistd.h>
#elif defined _WIN32
# include <windows.h>
#define sleep(x) Sleep(1000 * (x))
#endif

And for compiling, i've used this config:
Instructions used for Dev-C++:
-IDE used: Dev-C++ Orwell 5.2.0.0 32bit
-Compiler parameters used: -std=gnu99
-Linker parameters used: -static-libstdc++ -static-libgcc -lmingw32 -lSDL2main -lSDL2

Instructions used for MinGW:
-Version: MinGW-w64 v8.1.0
-Command line used:

gcc ps.c ^
	-Ic:\MinGW\mingw32\include ^
	-IC:\MinGW\mingw32\i686-w64-mingw32\include ^
	-Lc:\MinGW\mingw32\lib ^
	-LC:\MinGW\mingw32\i686-w64-mingw32\lib ^
	-static-libstdc++ ^
	-static-libgcc ^
	-lmingw32 ^
	-lSDL2main ^
	-lSDL2 ^
	-Os ^
	-o ps.exe

-Make sure SDL2 is placed correctly

P.D.: Tested the executable, and the exported wav and sounds identical to the youtube video about this project.

Thank you!
pc.c is fixed now
MAKE_WIN script has not been added yet. It may differ depending on where the mingw is launched (Linux or Windows)