Yeah ! It works !
Just in case someone find it useful in the future, here is how to compile handmade hero day 25 on linux using winegcc:
Here is my
build.sh
| #!/bin/bash
mkdir -p ../build
pushd ../build
winegcc -DHANDMADE_INTERNAL=1 -DHANDMADE_SLOW=1 -DHANDMADE_WIN32=1 -mwindows ../code/handmade.cpp ../code/handmade.spec -o handmadehero -g -Wno-write-strings -std=c++11 -shared -Wl, -fPIC
winegcc -DHANDMADE_INTERNAL=1 -DHANDMADE_SLOW=1 -DHANDMADE_WIN32=1 -mwindows ../code/win32_handmade.cpp -o handmadehero -g -Wno-write-strings -std=c++11
popd
|
Here is the content of handmade.spec:
| @ cdecl GameUpdateAndRender()
@ cdecl GameGetSoundSamples()
|
I do a search & replace of handmade.dll to
handmadehero.dll.so inside win32_handmade.cpp
And at last, I add theses two lines to win32_handmade.cpp
| #include <x86intrin.h> //a ajouter pour compiler
#define _snprintf_s(...) snprintf(__VA_ARGS__)
|
(given that they start with a # which is a comment in bash, I keep them in my
build.sh, ready to be cut and paste on each new handmade.cpp iteration)