Discussion: Windows MKXP #35

Closed
opened 2014-06-08 02:12:10 +00:00 by hanetzer · 187 comments
hanetzer commented 2014-06-08 02:12:10 +00:00 (Migrated from github.com)

been fiddling with building mkxp on windows, after catching a stray uint and trying again, it seems the main issue regarding building on windows is a gmtime_r conflict that occurs upon inclusion of ruby's win32.h

The exact error generated can be found in this gist:
https://gist.github.com/ntzrmtthihu777/e81aaa9cd95277bf9991#file-gistfile1-txt
Note: compiled with clang/clang++ for more verbose error output.

been fiddling with building mkxp on windows, after catching a stray uint and trying again, it seems the main issue regarding building on windows is a `gmtime_r` conflict that occurs upon inclusion of ruby's `win32.h` The exact error generated can be found in this gist: https://gist.github.com/ntzrmtthihu777/e81aaa9cd95277bf9991#file-gistfile1-txt Note: compiled with clang/clang++ for more verbose error output.
hanetzer commented 2014-06-08 22:43:51 +00:00 (Migrated from github.com)

found the smallest test program one could write to trigger this output,

#include <string>
#include "ruby.h"
int main() {
  return(0)
}

compiling with g++ test.cpp -Iruby-2.1.0/ -Iruby-2.1.0/x64-mingw32/ results in the above error

found the smallest test program one could write to trigger this output, ``` #include <string> #include "ruby.h" int main() { return(0) } ``` compiling with g++ test.cpp -Iruby-2.1.0/ -Iruby-2.1.0/x64-mingw32/ results in the above error
cremno commented 2014-06-08 22:56:48 +00:00 (Migrated from github.com)

Could you try compiling with -std=c++98? Maybe there is a reason why this isn't explicitly set. AFAIK mkxp itself doesn't use any GNU extensions.
But even if mkxp compiles fine with this workaround, CRuby's header shouldn't unconditionally declare gmtime_r.

Could you try compiling with `-std=c++98`? Maybe there is a reason why this isn't explicitly set. AFAIK mkxp itself doesn't use any GNU extensions. But even if mkxp compiles fine with this workaround, CRuby's header shouldn't unconditionally declare `gmtime_r`.
hanetzer commented 2014-06-08 23:16:34 +00:00 (Migrated from github.com)

ok, will give it a shot and report back. Note, reversing the #incldue directives fixes the issue in the test.cpp program, but its probably too minimal for application in mkxp itself.

ok, will give it a shot and report back. Note, reversing the #incldue directives fixes the issue in the test.cpp program, but its probably too minimal for application in mkxp itself.
hanetzer commented 2014-06-08 23:19:18 +00:00 (Migrated from github.com)

Nope, same error as before... this is rather annoying, windows, y u no posix!?

Nope, same error as before... this is rather annoying, windows, y u no posix!?
hanetzer commented 2014-06-09 00:35:29 +00:00 (Migrated from github.com)

I don't suppose you have access to a windows machine to test with? this is really irksome :/

I don't suppose you have access to a windows machine to test with? this is really irksome :/
Ancurio commented 2014-06-09 00:54:01 +00:00 (Migrated from github.com)

This is yours yes? https://www.ruby-forum.com/topic/4939821

Also this could be related: Also this could be related: http://sourceforge.net/p/mingw/bugs/1625/ (also this)

This is yours yes? https://www.ruby-forum.com/topic/4939821 Also this could be related: Also this could be related: http://sourceforge.net/p/mingw/bugs/1625/ (also [this](http://www.mail-archive.com/bug-gnulib@gnu.org/msg18445.html))
hanetzer commented 2014-06-09 01:22:32 +00:00 (Migrated from github.com)

Yes, that is mine, and I've seen both of those pages, lol. gmtime_r is defined in pthreads.h and time.h in the msys2 package mingw-w64-{i686,x86_64}-winpthreads-git
I'm going to bug the mingw-w64 folks as well

Yes, that is mine, and I've seen both of those pages, lol. `gmtime_r` is defined in `pthreads.h` and `time.h` in the msys2 package `mingw-w64-{i686,x86_64}-winpthreads-git` I'm going to bug the mingw-w64 folks as well
hanetzer commented 2014-06-09 02:46:48 +00:00 (Migrated from github.com)

Hmm... I've reported it to mingw-w64 and they're gonna convert gmtime_r to an inline from a macro, but my ruby bug report has been updated with including <ctime> as fixing the test program.

Hmm... I've reported it to mingw-w64 and they're gonna convert `gmtime_r` to an inline from a macro, but my ruby bug report has been updated with including `<ctime>` as fixing the test program.
hanetzer commented 2014-06-09 04:17:54 +00:00 (Migrated from github.com)

Yep, the patch fixes the gmtime_r issue but raises a new one.

Yep, the patch fixes the gmtime_r issue but raises a new one.
Ancurio commented 2014-06-09 04:22:18 +00:00 (Migrated from github.com)

What new issue?

What new issue?
hanetzer commented 2014-06-09 04:58:11 +00:00 (Migrated from github.com)

rand(), but including <stdlib.h> in pthread.h fixes that, now I just have to fix up this sdl_sound issue :p

rand(), but including `<stdlib.h>` in pthread.h fixes that, now I just have to fix up this sdl_sound issue :p
hanetzer commented 2014-06-09 05:25:19 +00:00 (Migrated from github.com)

Now the current issue is:
https://gist.github.com/ntzrmtthihu777/3b754e8aea64ad73141f
a whole bunch of undefined reference to ModPlug_* basically.

Now the current issue is: https://gist.github.com/ntzrmtthihu777/3b754e8aea64ad73141f a whole bunch of undefined reference to ModPlug_\* basically.
Ancurio commented 2014-06-09 15:21:40 +00:00 (Migrated from github.com)

Oh, you're statically linking. Yeah, the problem is very likely my limited pkgconfig file for SDL_sound which doesn't pass on the correct linker flags in case of static linking. You could compile SDL_sound with only WAV support as a temporary workaround for now, or compile it into a dll instead.

Oh, you're statically linking. Yeah, the problem is very likely my limited pkgconfig file for SDL_sound which doesn't pass on the correct linker flags in case of static linking. You could compile SDL_sound with only WAV support as a temporary workaround for now, or compile it into a dll instead.
Ancurio commented 2014-06-09 15:28:35 +00:00 (Migrated from github.com)

Alternatively, since all this needs is a -lmodplug, you could either add that manually in the Makefile, or try adding the line Requires.private: libmodplug to your SDL_sound.pc.

Alternatively, since all this needs is a `-lmodplug`, you could either add that manually in the Makefile, or try adding the line `Requires.private: libmodplug` to your SDL_sound.pc.
hanetzer commented 2014-06-09 18:10:43 +00:00 (Migrated from github.com)

yeah. I don't really want to link static, but I can't seem to get sdl_sound's hg version with the patch to compile into a shared library; its driving me crazy, lol.

yeah. I don't really want to link static, but I can't seem to get sdl_sound's hg version with the patch to compile into a shared library; its driving me crazy, lol.
hanetzer commented 2014-06-09 19:03:19 +00:00 (Migrated from github.com)

Success! well, to a degree... It compiles and 'runs', but though I do hear the music and it does accept options from mkxp.conf and opens a window, the window is nothing but solid black...

Success! well, to a degree... It compiles and 'runs', but though I do hear the music and it does accept options from mkxp.conf and opens a window, the window is nothing but solid black...
hanetzer commented 2014-06-09 19:56:00 +00:00 (Migrated from github.com)

On another note, setting -Wl,-subsystem,windows to stop cmd.exe from opening works to a degree, but unless you invoke mkxp.exe from the msys shell it won't work (eg, double clicking it or running it via rpg maker). In addition, setting FORCE32 won't compile either, resulting in this error log: https://gist.github.com/ntzrmtthihu777/79eaefcb75c9ce551522

On another note, setting `-Wl,-subsystem,windows` to stop cmd.exe from opening works to a degree, but unless you invoke mkxp.exe from the msys shell it won't work (eg, double clicking it or running it via rpg maker). In addition, setting FORCE32 won't compile either, resulting in this error log: https://gist.github.com/ntzrmtthihu777/79eaefcb75c9ce551522
Ancurio commented 2014-06-09 20:15:41 +00:00 (Migrated from github.com)

I was worried that the gmtime_r issue came up again, but it seems you edited the gist and now the errors are gone?

Anyway, I have a slight idea about the first three errors. Can you apply this patch and try again?

I was worried that the gmtime_r issue came up again, but it seems you edited the gist and now the errors are gone? Anyway, I have a slight idea about the first three errors. Can you apply this [patch](https://gist.github.com/Ancurio/cc74862c3e0e321954b7) and try again?
hanetzer commented 2014-06-10 05:07:11 +00:00 (Migrated from github.com)

Yeah, the gmtime_r issue was there again, but that was because I hadn't patched win32.h for ruby on the 32 bit side.
Ok, will check it out when I get back on my main machine; note, those compilation errors on occur when compiling 32bit.

Yeah, the gmtime_r issue was there again, but that was because I hadn't patched win32.h for ruby on the 32 bit side. Ok, will check it out when I get back on my main machine; note, those compilation errors on occur when compiling 32bit.
hanetzer commented 2014-06-10 12:30:45 +00:00 (Migrated from github.com)

Nope, exact same output. I would like to mention that appending -fpermissive to the arguments does allow it to compile and 'play' (same results as the 64-bit compile) but this is akin to sweeping the problem under the rug and not really fixing anything.

If possible, I'd like to work on actually getting a playable game, though. I'll mention that mkxp.conf settings do get applied.
Also, I do get the OpenGL info in the console as well:

GL Vendor    : NVIDIA Corporation
GL Renderer  : GeForce GTX 650/PCIe/SSE2
GL Version   : 4.4.0
GLSL Version : 4.40 NVIDIA via Cg compiler
Nope, exact same output. I would like to mention that appending `-fpermissive` to the arguments does allow it to compile and 'play' (same results as the 64-bit compile) but this is akin to sweeping the problem under the rug and not really fixing anything. If possible, I'd like to work on actually getting a playable game, though. I'll mention that mkxp.conf settings _do_ get applied. Also, I do get the OpenGL info in the console as well: ``` GL Vendor : NVIDIA Corporation GL Renderer : GeForce GTX 650/PCIe/SSE2 GL Version : 4.4.0 GLSL Version : 4.40 NVIDIA via Cg compiler ```
Ancurio commented 2014-06-10 17:01:29 +00:00 (Migrated from github.com)

Hm. It looks like glew.h correctly defines APIENTRY to __stdcall, but then unconditionally undefs it again, wtf? Anyway..

Yes, it looks like everything is working, but for some reason the result of the OpenGL rendering isn't being swapped to the screen. In mkxp.conf, have you turned debugMode on? If you turn that on, check the console output again for any messages.

Hm. It looks like glew.h correctly defines `APIENTRY` to `__stdcall`, but then unconditionally undefs it again, wtf? Anyway.. Yes, it looks like everything is working, but for some reason the result of the OpenGL rendering isn't being swapped to the screen. In mkxp.conf, have you turned `debugMode` on? If you turn that on, check the console output again for any messages.
hanetzer commented 2014-06-10 17:05:15 +00:00 (Migrated from github.com)

Assuming the proper syntax is debugMode=true, then yes. But, it doesn't do a thing, lol. Other mkxp.conf options work, however; to test that I set the screen to 800x600

Assuming the proper syntax is `debugMode=true`, then yes. But, it doesn't do a thing, lol. Other mkxp.conf options work, however; to test that I set the screen to 800x600
Ancurio commented 2014-06-10 17:41:15 +00:00 (Migrated from github.com)

Can you try to compile and run this test program: https://gist.github.com/Ancurio/001987a2e0b172a036b0 (only depends on sdl2)

Can you try to compile and run this test program: https://gist.github.com/Ancurio/001987a2e0b172a036b0 (only depends on sdl2)
hanetzer commented 2014-06-10 17:52:44 +00:00 (Migrated from github.com)

hrm... being a pita on me. gcc -c -I /mingw64/include/SDL2 with and without -Dmain=SDL_main is giving me some nice headaches :/
https://gist.github.com/ntzrmtthihu777/e1ec2c096910099b6652

hrm... being a pita on me. `gcc -c -I /mingw64/include/SDL2` with and without `-Dmain=SDL_main` is giving me some nice headaches :/ https://gist.github.com/ntzrmtthihu777/e1ec2c096910099b6652
hanetzer commented 2014-06-10 17:58:32 +00:00 (Migrated from github.com)

setting main to int main(int argc, char *argv[]) fixed that up though... apparently sdl needs this exact entry point structure, strange no?

setting main to `int main(int argc, char *argv[])` fixed that up though... apparently sdl needs this _exact_ entry point structure, strange no?
Ancurio commented 2014-06-10 18:12:01 +00:00 (Migrated from github.com)

My bad, I have updated the gist with an improved version that should compile on windows now. Can you try again?

setting main to int main(int argc, char *argv[]) fixed that up though... apparently sdl needs this exact entry point structure, strange no?

Yes, this is because on windows your main function isn't the actual main function =) SDL2 wraps around this and renames your main function, so the types have to match exactly. C++ only allows one signature, while C let's me do silly things like void main(void).

My bad, I have updated the gist with an improved version that should compile on windows now. Can you try again? > setting main to int main(int argc, char *argv[]) fixed that up though... apparently sdl needs this exact entry point structure, strange no? Yes, this is because on windows your main function isn't the actual main function =) SDL2 wraps around this and renames your main function, so the types have to match exactly. C++ only allows one signature, while C let's me do silly things like `void main(void)`.
hanetzer commented 2014-06-10 20:07:56 +00:00 (Migrated from github.com)

There we go. gcc -o non_mainthread_gl.exe non_mainthread_gl.c -I /mingw64/include/SDL2 -lmingw32 -lSDL2main -lSDL2 gives me a nice executable that does nothing other than to display a 640 480 red window, is this correct?

There we go. `gcc -o non_mainthread_gl.exe non_mainthread_gl.c -I /mingw64/include/SDL2 -lmingw32 -lSDL2main -lSDL2` gives me a nice executable that does nothing other than to display a 640 480 red window, is this correct?
Ancurio commented 2014-06-10 20:19:33 +00:00 (Migrated from github.com)

Does it switch to blue after a while? Also try resizing the window.

Does it switch to blue after a while? Also try resizing the window.
hanetzer commented 2014-06-10 20:53:55 +00:00 (Migrated from github.com)

Sorry, didn't wait for it to change, lol. and yes, as I type this its shifting through purple into blue, and I can resize it down to just a bit larger than the window manager keys. (Just tested resizing with mkxp as well, I can resize it as much as I need, including the alt+enter fullscreen mode)

Sorry, didn't wait for it to change, lol. and yes, as I type this its shifting through purple into blue, and I can resize it down to just a bit larger than the window manager keys. (Just tested resizing with mkxp as well, I can resize it as much as I need, including the alt+enter fullscreen mode)
hanetzer commented 2014-06-10 21:04:30 +00:00 (Migrated from github.com)

Actually I just noticed something. I think its an issue with event polling/passing. Even if the display isn't updating, you'd think that I could at least hear myself move the cursor up/down on the title screen of a default RMXP project, but nope. To further support this idea, that little SDL2 application you had me compile, I could close that either via ctrl+c in my console or by hitting the standard x button in the corner; I couldn't close the mkxp window with the window manager button, which makes me think the window destroy event never got passed along.

Actually I just noticed something. I think its an issue with event polling/passing. Even if the display isn't updating, you'd think that I could at least hear myself move the cursor up/down on the title screen of a default RMXP project, but nope. To further support this idea, that little SDL2 application you had me compile, I could close that either via ctrl+c in my console _or_ by hitting the standard x button in the corner; I couldn't close the mkxp window with the window manager button, which makes me think the window destroy event never got passed along.
Ancurio commented 2014-06-10 21:14:24 +00:00 (Migrated from github.com)

Ah, yes, that's what I was going to ask about next. You said that the intro music plays fine though?

If you hit the x button, and wait a while, does a dialog come up saying something like "RGSS script is stuck"?

Ah, yes, that's what I was going to ask about next. You said that the intro music plays fine though? If you hit the x button, and wait a while, does a dialog come up saying something like "RGSS script is stuck"?
hanetzer commented 2014-06-10 21:22:51 +00:00 (Migrated from github.com)

Yep, The RGSS Script seems to be stuck and mkxp will now force quit.

Yep, `The RGSS Script seems to be stuck and mkxp will now force quit`.
Ancurio commented 2014-06-10 21:32:00 +00:00 (Migrated from github.com)

Good, that means the main thread is doing ok and receiving events just fine. Somehow the rgss thread must have gotten stuck somewhere (possibly before the first Graphics.update call).

Do you have gdb at your disposal? We need to find out where the thread is stuck. It's usually enough to pause execution via Ctrl C and then type thread apply all bt.

Good, that means the main thread is doing ok and receiving events just fine. Somehow the rgss thread must have gotten stuck somewhere (possibly before the first `Graphics.update` call). Do you have gdb at your disposal? We need to find out where the thread is stuck. It's usually enough to pause execution via `Ctrl C` and then type `thread apply all bt`.
hanetzer commented 2014-06-10 21:38:24 +00:00 (Migrated from github.com)

Yes, I have gdb :P and I have a large amount of *nix programs available on windows, in a normal filesystem hierarchy standard for arch linux.

Yes, I have gdb :P and I have a large amount of *nix programs available on windows, in a normal filesystem hierarchy standard for arch linux.
hanetzer commented 2014-06-10 21:40:59 +00:00 (Migrated from github.com)

urm... lets see. How would I go about getting gdb linked into the mkxp process? gdb mkxp.exe followed by run just quits when I hit ctrl c.

urm... lets see. How would I go about getting gdb linked into the mkxp process? `gdb mkxp.exe` followed by `run` just quits when I hit ctrl c.
Ancurio commented 2014-06-10 21:46:59 +00:00 (Migrated from github.com)

Ok, according to this there's a couple workarounds for CtrlC not working on windows. I don't know which one is simpler, but I think just running mkxp and then attaching gdb with gdb <pid of mkxp> avoids compiling a helper program. Can you try one of them?

Edit: The correct command might actually be gdb mkxp.exe <pid>

Ok, according to [this](http://stackoverflow.com/questions/711086/in-gdb-on-mingw-how-to-make-ctrl-c-stop-the-program) there's a couple workarounds for CtrlC not working on windows. I don't know which one is simpler, but I think just running mkxp and then attaching gdb with `gdb <pid of mkxp>` avoids compiling a helper program. Can you try one of them? Edit: The correct command might actually be `gdb mkxp.exe <pid>`
hanetzer commented 2014-06-10 21:51:32 +00:00 (Migrated from github.com)

hrm... I don't have pidof available... lemme query my package manager... shit.

hrm... I don't have pidof available... lemme query my package manager... shit.
hanetzer commented 2014-06-10 22:18:51 +00:00 (Migrated from github.com)

Got it working, just used a normal cmd.exe window (my gdb is compiled with mingw-w64, so it is native), now what info do you need?

Got it working, just used a normal cmd.exe window (my gdb is compiled with mingw-w64, so it is native), now what info do you need?
Ancurio commented 2014-06-10 22:26:15 +00:00 (Migrated from github.com)

I need a full backtrace of all threads, via thread apply all bt.

I need a full backtrace of all threads, via `thread apply all bt`.
hanetzer commented 2014-06-10 22:26:21 +00:00 (Migrated from github.com)

Ok, learned how to create a logfile of gdb ouput, so here you go: https://gist.github.com/ntzrmtthihu777/8403b107ffa2f252287d

Ok, learned how to create a logfile of gdb ouput, so here you go: https://gist.github.com/ntzrmtthihu777/8403b107ffa2f252287d
Ancurio commented 2014-06-10 22:30:11 +00:00 (Migrated from github.com)

Cool. Can you give me another dump, this time with thread apply all bt full? Afterwards, try setting fixedFramerate=-1 in the conf and run mkxp normally.

Cool. Can you give me another dump, this time with `thread apply all bt full`? Afterwards, try setting `fixedFramerate=-1` in the conf and run mkxp normally.
hanetzer commented 2014-06-10 22:35:23 +00:00 (Migrated from github.com)

holy shit! one, updated the gist with the log from thread apply all bt full, and then tested with fixedFramerate=-1 and it worked! Heh, I get to the title screen and it says its running at about 3k fps, and I can start the game and move around and such, but its all very very fast. But it is 'working' better than it was, at the very least.

holy shit! one, updated the gist with the log from `thread apply all bt full`, and then tested with `fixedFramerate=-1` and it worked! Heh, I get to the title screen and it says its running at about 3k fps, and I can start the game and move around and such, but its all very very fast. But it is 'working' better than it was, at the very least.
Ancurio commented 2014-06-10 22:39:26 +00:00 (Migrated from github.com)

Yes, setting fixedFramerate=-1 skips execution of where the thread appears to hang =) (It also means that, without vsync turned on, the game will render as fast as possible).

I first suspected that FPSLimiter::delayTicks gets a too big number, but looking again I think this segment might be the problem:

struct timespec req;
req.tv_sec = 0;
req.tv_nsec = ticks / tickFreqNS;
while (nanosleep(&req, &req) == -1)
    ;
Yes, setting `fixedFramerate=-1` skips execution of where the thread appears to hang =) (It also means that, without vsync turned on, the game will render as fast as possible). I first suspected that FPSLimiter::delayTicks gets a too big number, but looking again I think this segment might be the problem: ``` struct timespec req; req.tv_sec = 0; req.tv_nsec = ticks / tickFreqNS; while (nanosleep(&req, &req) == -1) ; ```
hanetzer commented 2014-06-10 22:42:32 +00:00 (Migrated from github.com)

Sweet man, hope this gets fixed up soon :D On another note, from your vsync comment, I set that to true in mkxp.conf and it yealded a perfectly playable game running at 60fps, though I think the original RPG Maker XP Game.exe ran at 40fps or so. But I suspect that's another of those 'sweeping it under the rug' things. In any case, if you need testers on windows I'm more than willing to help, as I have shown, lol. I'm actually primarily a linux guy, but hey, I'd like good features on the windows version of a game I make as well :P

Sweet man, hope this gets fixed up soon :D On another note, from your vsync comment, I set that to true in mkxp.conf and it yealded a perfectly playable game running at 60fps, though I think the original RPG Maker XP Game.exe ran at 40fps or so. But I suspect that's another of those 'sweeping it under the rug' things. In any case, if you need testers on windows I'm more than willing to help, as I have shown, lol. I'm actually primarily a linux guy, but hey, I'd like good features on the windows version of a game I make as well :P
hanetzer commented 2014-06-10 22:57:14 +00:00 (Migrated from github.com)

hrm. On another note, setting -Wl,-subsystem,windows to get rid of the console window popping up still fails when you double-click execute, but works fine from the shell :/

hrm. On another note, setting `-Wl,-subsystem,windows` to get rid of the console window popping up still fails when you double-click execute, but works fine from the shell :/
cremno commented 2014-06-10 23:01:46 +00:00 (Migrated from github.com)

What about -mwindows instead?

What about `-mwindows` instead?
hanetzer commented 2014-06-10 23:13:47 +00:00 (Migrated from github.com)

one moment :P ... nope, same result. I'll see about editing the sdl2.pc file, I know the packager for the project I'm using does some derpy stuff with them sometimes :/

one moment :P ... nope, same result. I'll see about editing the `sdl2.pc` file, I know the packager for the project I'm using does some derpy stuff with them sometimes :/
Ancurio commented 2014-06-10 23:27:38 +00:00 (Migrated from github.com)

nanosleep might be returning -1, but not because it was interrupted but due to another error. When mkxp hangs without the fixedFramerate setting, does Task Manager show a high CPU usage for it?

`nanosleep` might be returning -1, but not because it was interrupted but due to another error. When mkxp hangs without the fixedFramerate setting, does Task Manager show a high CPU usage for it?
hanetzer commented 2014-06-10 23:43:35 +00:00 (Migrated from github.com)

guess that's a relative term. Without the fixedFramerate, cpu shows 17. With it, it shows 16/17. But, then again I do have a pretty beefy cpu, AMD FX-6300 hex core @ 3.5ghz

guess that's a relative term. Without the fixedFramerate, cpu shows 17. With it, it shows 16/17. But, then again I do have a pretty beefy cpu, AMD FX-6300 hex core @ 3.5ghz
Ancurio commented 2014-06-11 00:04:36 +00:00 (Migrated from github.com)

100% / 6 cores = ~17%, so it might indeed be spinning inside the while.

Can you apply this patch and recompile: https://gist.github.com/Ancurio/ae83d3bacc7991e5ca5b

100% / 6 cores = ~17%, so it might indeed be spinning inside the while. Can you apply this patch and recompile: https://gist.github.com/Ancurio/ae83d3bacc7991e5ca5b
hanetzer commented 2014-06-11 00:10:25 +00:00 (Migrated from github.com)

Yep, recompiled and I get debug output of nanosleep failed. errno: 22 ticks: ********** and the super zoomed up speed issue.

Yep, recompiled and I get debug output of `nanosleep failed. errno: 22 ticks: **********` and the super zoomed up speed issue.
Ancurio commented 2014-06-11 01:12:02 +00:00 (Migrated from github.com)

Here's a patch ontop of the previous one that just disables the nanosleep and uses the fallback, should work decently well: https://gist.github.com/Ancurio/238eeddf89d058947eb1

I'll have to investigate why nanosleep is failing another time. Also, ticks: ********** are those really *s or is it printing actual numbers?

Here's a patch ontop of the previous one that just disables the nanosleep and uses the fallback, should work decently well: https://gist.github.com/Ancurio/238eeddf89d058947eb1 I'll have to investigate why nanosleep is failing another time. Also, `ticks: **********` are those really *s or is it printing actual numbers?
hanetzer commented 2014-06-11 01:15:36 +00:00 (Migrated from github.com)

Actual numbers, counting up it seems. Also, I'm not on my main machine again so I can't test yet, sorry, but thanks for helping me out all this way.

Actual numbers, counting up it seems. Also, I'm not on my main machine again so I can't test yet, sorry, but thanks for helping me out all this way.
hanetzer commented 2014-06-11 20:13:22 +00:00 (Migrated from github.com)

seems to actually do pretty nicely, considering. Its an even 40-ish fps and not freezing up.

seems to actually do pretty nicely, considering. Its an even 40-ish fps and not freezing up.
hanetzer commented 2014-06-12 07:24:23 +00:00 (Migrated from github.com)

still doesn't launch outside of a msys shell though :/

still doesn't launch outside of a msys shell though :/
hanetzer commented 2014-06-12 10:08:57 +00:00 (Migrated from github.com)

Recompiled with debugging symbols, thought it may be of more help: https://gist.github.com/ntzrmtthihu777/723ff275bd37e6b88d47

Recompiled with debugging symbols, thought it may be of more help: https://gist.github.com/ntzrmtthihu777/723ff275bd37e6b88d47
Ancurio commented 2014-06-12 11:12:52 +00:00 (Migrated from github.com)

Thanks, but to fix this I'd have to look at the whole stackframe of that function to see which variables have out of place values =P

If you want to give it a try: select the frame with thread 9, then select the ::delayTicks frame with frame 2, and finally dump the variables with info locals.

Edit: Oh, a print *this would also be helpful!

Thanks, but to fix this I'd have to look at the whole stackframe of that function to see which variables have out of place values =P If you want to give it a try: select the frame with `thread 9`, then select the `::delayTicks` frame with `frame 2`, and finally dump the variables with `info locals`. Edit: Oh, a `print *this` would also be helpful!
Ancurio commented 2014-06-12 11:22:28 +00:00 (Migrated from github.com)

Btw. I have pushed some commits that do more or less what the patches I posted earlier; if you want to pull these new commits, you'll have clear the temp changes with git checkout src first. You can do that later though.

You might get spammed with "nanosleep failed" messages in the console, but mkxp should still continue to run at 40FPS.

Btw. I have pushed some commits that do more or less what the patches I posted earlier; if you want to pull these new commits, you'll have clear the temp changes with `git checkout src` first. You can do that later though. You might get spammed with "nanosleep failed" messages in the console, but mkxp should still continue to run at 40FPS.
hanetzer commented 2014-06-12 11:28:29 +00:00 (Migrated from github.com)

gladly, but I'm not sure how to do that thread 9 and so on :P

gladly, but I'm not sure how to do that `thread 9` and so on :P
Ancurio commented 2014-06-12 11:31:56 +00:00 (Migrated from github.com)

those are just commands into gdb, you input them the same as the thread apply all bt call.

those are just commands into gdb, you input them the same as the `thread apply all bt` call.
hanetzer commented 2014-06-12 12:00:27 +00:00 (Migrated from github.com)

hrm. On that note, do I need something in mkxp.conf for this exercise?

hrm. On that note, do I need something in mkxp.conf for this exercise?
hanetzer commented 2014-06-12 12:05:19 +00:00 (Migrated from github.com)
#4  0x00000000004326e8 in FPSLimiter::delayTicks (this=0x29f1d98, ticks=0)
    at mkxp/src/graphics.cpp:353
353                     while (nanosleep(&req, &req) == -1)
req = {tv_sec = 9223372036, tv_nsec = 854775808}
nsec = 9223372036854775808

Hope I did that right, lol.

``` #4 0x00000000004326e8 in FPSLimiter::delayTicks (this=0x29f1d98, ticks=0) at mkxp/src/graphics.cpp:353 353 while (nanosleep(&req, &req) == -1) req = {tv_sec = 9223372036, tv_nsec = 854775808} nsec = 9223372036854775808 ``` Hope I did that right, lol.
Ancurio commented 2014-06-12 12:08:42 +00:00 (Migrated from github.com)

Yep, that's exactly what I needed. Can you do a print *this as well?

Yep, that's exactly what I needed. Can you do a `print *this` as well?
hanetzer commented 2014-06-12 12:18:36 +00:00 (Migrated from github.com)
#4  0x00000000004326e8 in FPSLimiter::delayTicks (this=0x2d51d98, ticks=0)
    at mkxp/src/graphics.cpp:353
353                     while (nanosleep(&req, &req) == -1)
req = {tv_sec = 9223372036, tv_nsec = 854775808}
nsec = 9223372036854775808
$1 = {lastTickCount = 66755790824, tpf = 85451, tickFreq = 3418056,
  tickFreqMS = 3418, tickFreqNS = 0, disabled = false, adj = {
    last = 66755790826, idealDiff = 0, resetFlag = true}}

This?

``` #4 0x00000000004326e8 in FPSLimiter::delayTicks (this=0x2d51d98, ticks=0) at mkxp/src/graphics.cpp:353 353 while (nanosleep(&req, &req) == -1) req = {tv_sec = 9223372036, tv_nsec = 854775808} nsec = 9223372036854775808 $1 = {lastTickCount = 66755790824, tpf = 85451, tickFreq = 3418056, tickFreqMS = 3418, tickFreqNS = 0, disabled = false, adj = { last = 66755790826, idealDiff = 0, resetFlag = true}} ``` This?
Ancurio commented 2014-06-12 12:33:35 +00:00 (Migrated from github.com)

Yeah, perfect. I pushed a potential fix for this entire issue, can you pull that and try again?

Yeah, perfect. I pushed a potential fix for this entire issue, can you pull that and try again?
hanetzer commented 2014-06-12 12:42:29 +00:00 (Migrated from github.com)

will do. Seems to have done the trick regarding the whole shebang; I can run fine without any mkxp.conf tricks, though I still can't make it run with a double-click using the -Wl,-subsystem,windows or -mwindows flags... that's a bit annoying, lol.

will do. Seems to have done the trick regarding the whole shebang; I can run fine without any mkxp.conf tricks, though I still can't make it run with a double-click using the `-Wl,-subsystem,windows` or `-mwindows` flags... that's a bit annoying, lol.
Ancurio commented 2014-06-12 12:58:20 +00:00 (Migrated from github.com)

Great to hear that this annoying issue is finally gone =P

I'm not really a MinGW expert, so I can't help you much with the shell window issue though..

Great to hear that this annoying issue is finally gone =P I'm not really a MinGW expert, so I can't help you much with the shell window issue though..
hanetzer commented 2014-06-12 12:59:32 +00:00 (Migrated from github.com)

yeah, thanks though. Walking through this bit has given me a bit more info to work with as far as how to go about debugging something :P

yeah, thanks though. Walking through this bit has given me a bit more info to work with as far as _how_ to go about debugging something :P
hanetzer commented 2014-06-13 02:11:30 +00:00 (Migrated from github.com)

Think I may try to build via code::blocks... this cmake stuff is killing me, what ever happened to good ol' ./configure && make && make install :/

Think I may try to build via code::blocks... this cmake stuff is killing me, what ever happened to good ol' `./configure && make && make install` :/
khkramer commented 2014-06-26 11:32:07 +00:00 (Migrated from github.com)

Did you get this to build correctly in the end?

I'm currently trying to cross-compile for windows also, but I'm not having much luck yet (moreso because pkg-config is not finding my libs compiled with mingw)

Did you get this to build correctly in the end? I'm currently trying to cross-compile for windows also, but I'm not having much luck yet (moreso because pkg-config is not finding my libs compiled with mingw)
sorlok commented 2014-06-26 15:24:39 +00:00 (Migrated from github.com)

Are you using the cmake build or the ./configure based build?

Are you using the cmake build or the ./configure based build?
khkramer commented 2014-06-26 17:31:02 +00:00 (Migrated from github.com)

I'm using cmake

I'm using cmake
sorlok commented 2014-06-26 17:39:59 +00:00 (Migrated from github.com)

CMake only uses pkg-config in certain cases to help "guess" where the library is located. You can provide these hints yourself with, e.g. for Boost, BOOST_INCLUDEDIR and BOOST_LIBRARYDIR. If your goal is simply to get this compiled on Windows, setting these variables for each library manually (to point to your MinGW install directory) is probably the easiest way to get it working.

Edit: When you say "cross-compile", do you mean compiling on Linux for Windows, or compiling on Windows for Windows? My comment was for the latter; if it's the former, there's a different way of doing that with cmake.

CMake only uses pkg-config in certain cases to help "guess" where the library is located. You can provide these hints yourself with, e.g. for Boost, BOOST_INCLUDEDIR and BOOST_LIBRARYDIR. If your goal is simply to get this compiled on Windows, setting these variables for each library manually (to point to your MinGW install directory) is probably the easiest way to get it working. _Edit:_ When you say "cross-compile", do you mean compiling on Linux for Windows, or compiling on Windows for Windows? My comment was for the latter; if it's the former, there's a different way of doing that with cmake.
hanetzer commented 2014-06-26 21:20:36 +00:00 (Migrated from github.com)

@khkramer I got it to work, I have a working windows binary in both 32 and 64 bit.
You can pass PKG_CONFIG_PATH to point at the mingw pkgconfig folder in lib, but that's location depends on what distro you are using.

@khkramer I got it to work, I have a working windows binary in both 32 and 64 bit. You can pass `PKG_CONFIG_PATH` to point at the mingw pkgconfig folder in lib, but that's location depends on what distro you are using.
khkramer commented 2014-06-27 13:12:41 +00:00 (Migrated from github.com)

@sorlok

I tried compiling on Linux for Windows first, I'm now trying on windows with cygwin.
The only problem now is getting it to properly detect boost, I'm pointing it towards the right directory but it says It can't read version.hpp.

@ntzrmtthihu777

Would you mind sending me your binaries?
They might work for my project, if they do it would save some time.

@sorlok I tried compiling on Linux for Windows first, I'm now trying on windows with cygwin. The only problem now is getting it to properly detect boost, I'm pointing it towards the right directory but it says It can't read version.hpp. @ntzrmtthihu777 Would you mind sending me your binaries? They might work for my project, if they do it would save some time.
hanetzer commented 2014-06-27 14:00:40 +00:00 (Migrated from github.com)

@khkramer
You don't want the binaries I currently possess, they're still a bit buggy. I'll recompile once I resetup msys2 (you should really use this instead of cygwin/msys :P) on my winxp virtual machine.

@khkramer You don't want the binaries I currently possess, they're still a bit buggy. I'll recompile once I resetup msys2 (you should really use this instead of cygwin/msys :P) on my winxp virtual machine.
khkramer commented 2014-06-27 14:22:55 +00:00 (Migrated from github.com)

I actually got it to correctly find boost now with -DBoost_USE_STATIC_LIBS=ON
However It's still missing OpenAL and I don't know which version of OpenAL it wants, I've googled and I've find varying implementations of OpenAL, which one should I build?
And I'll try out Msys2, thanks for the suggestion.

I actually got it to correctly find boost now with -DBoost_USE_STATIC_LIBS=ON However It's still missing OpenAL and I don't know which version of OpenAL it wants, I've googled and I've find varying implementations of OpenAL, which one should I build? And I'll try out Msys2, thanks for the suggestion.
hanetzer commented 2014-06-27 14:31:17 +00:00 (Migrated from github.com)

the one from http://www.openal.org

the one from http://www.openal.org
Ancurio commented 2014-06-27 14:59:44 +00:00 (Migrated from github.com)

However It's still missing OpenAL and I don't know which version of OpenAL it wants, I've googled and I've find varying implementations of OpenAL, which one should I build?

OpenAL Soft

> However It's still missing OpenAL and I don't know which version of OpenAL it wants, I've googled and I've find varying implementations of OpenAL, which one should I build? [OpenAL Soft](http://kcat.strangesoft.net/openal.html)
khkramer commented 2014-06-27 15:24:05 +00:00 (Migrated from github.com)

Got it.

My next question might be a slightly stupid one but would I be able to build with Ruby 1.9 instead of 2.0?

Got it. My next question might be a slightly stupid one but would I be able to build with Ruby 1.9 instead of 2.0?
Ancurio commented 2014-06-27 15:45:41 +00:00 (Migrated from github.com)

My next question might be a slightly stupid one but would I be able to build with Ruby 1.9 instead of 2.0?

I haven't worked at all with 1.9 before, so I can't say. At a minimum, it would have to produce a library-fied version (libruby.so), I'm not sure when they added that. If errors you encounter are sufficiently trivial, we can patch mkxp to work with 1.9 as well.

> My next question might be a slightly stupid one but would I be able to build with Ruby 1.9 instead of 2.0? I haven't worked at all with 1.9 before, so I can't say. At a minimum, it would have to produce a library-fied version (libruby.so), I'm not sure when they added that. If errors you encounter are sufficiently trivial, we can patch mkxp to work with 1.9 as well.
khkramer commented 2014-06-27 16:11:00 +00:00 (Migrated from github.com)

CMake finally made me some makefiles.
When I try building I get this error:

make[2]: XXD_EXE-NOTFOUND: Command not found

At first I thought I had to install xxd but that didn't fix it.

CMake finally made me some makefiles. When I try building I get this error: ``` make[2]: XXD_EXE-NOTFOUND: Command not found ``` At first I thought I had to install xxd but that didn't fix it.
Ancurio commented 2014-06-27 16:26:49 +00:00 (Migrated from github.com)

xxd is a (more or less) standard unix tool; I think any mingw/msys installation should ship with it. Now, as to how cmake finds it on windows.. I don't know (I didn't write the CMake script).

You probably have to explicitly pass the path to your xxd binary to cmake, @ntzrmtthihu777 should know how to do this.

Edit: Nvm my first sentence, xxd is actually part of vim, so you will need some form of vim package for mingw to get it.

xxd is a (more or less) standard unix tool; I think any mingw/msys installation should ship with it. Now, as to how cmake finds it on windows.. I don't know (I didn't write the CMake script). You probably have to explicitly pass the path to your xxd binary to cmake, @ntzrmtthihu777 should know how to do this. Edit: Nvm my first sentence, `xxd` is actually part of vim, so you will need some form of vim package for mingw to get it.
khkramer commented 2014-06-27 16:59:40 +00:00 (Migrated from github.com)

I was able to set it with -DXXD_EXE.
Here comes another error C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp: In function ‘void showExc(VALUE)’:
C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp:377:28: error: expected ‘)’ before ‘PRIsVALUE’
VALUE ds = rb_sprintf("%" PRIsVALUE ": %" PRIsVALUE " (%" PRIsVALUE ")",
^
C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp:381:32: error: expected ‘)’ before ‘PRIsVALUE’
rb_str_catf(ds, "\n\tfrom %" PRIsVALUE, rb_ary_entry(bt, i));
^
C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp:393:36: error: expected ‘)’ before ‘PRIsVALUE’
VALUE ms = rb_sprintf("Script '%" PRIsVALUE "' line %" PRIsVALUE
^
C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp: In function ‘void mriBindingExecute()’:
C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp:401:13: error: ‘ruby_setup’ was not declared in this scope
ruby_setup();
^


Might It have used a wrong version of ruby perhaps?
I was able to set it with -DXXD_EXE. Here comes another error C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp: In function ‘void showExc(VALUE)’: C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp:377:28: error: expected ‘)’ before ‘PRIsVALUE’ VALUE ds = rb_sprintf("%" PRIsVALUE ": %" PRIsVALUE " (%" PRIsVALUE ")", ^ C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp:381:32: error: expected ‘)’ before ‘PRIsVALUE’ rb_str_catf(ds, "\n\tfrom %" PRIsVALUE, rb_ary_entry(bt, i)); ^ C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp:393:36: error: expected ‘)’ before ‘PRIsVALUE’ VALUE ms = rb_sprintf("Script '%" PRIsVALUE "' line %" PRIsVALUE ^ C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp: In function ‘void mriBindingExecute()’: C:/CygWinDeluxe/home/Klaas-Hessel/mkxp/binding-mri/binding-mri.cpp:401:13: error: ‘ruby_setup’ was not declared in this scope ruby_setup(); ^ ``` Might It have used a wrong version of ruby perhaps? ```
cremno commented 2014-06-27 18:21:07 +00:00 (Migrated from github.com)

PRIsVALUE and ruby_setup were added with 2.0.0.

Fixing the first one is possible, but I don't like the required changes.

Using ruby_init instead of ruby_setup is okay. But it exits the program without any message in case of an error. Also, as of now mkxp would most likely crash, because it doesn't check the return value of ruby_setup.

Do you really want to see 1.9.3 supported? There are only a few incompatibilities between 1.9.3 and 2.0.0 (or 2.1).

`PRIsVALUE` and `ruby_setup` were added with 2.0.0. Fixing the first one is possible, but I don't like the required changes. Using `ruby_init` instead of `ruby_setup` is okay. But it `exit`s the program without any message in case of an error. Also, as of now mkxp would most likely crash, because it doesn't check the return value of `ruby_setup`. Do you really want to see 1.9.3 supported? There are only a few incompatibilities between 1.9.3 and 2.0.0 (or 2.1).
Ancurio commented 2014-06-27 18:47:58 +00:00 (Migrated from github.com)

Ah, thanks for chiming in cremno, I was going to ask you :D

Yeah, this mindset of ruby 1.9 that it's the main executable code and can just exit() on error is really problematic. I mean, you could probably still run games with it, but getting any decent error messages would be impossible, not to even speak of all the unreleased resources at the end.

If you still want to go with 1.9, you might want to try commenting out the entire body of showExc() and replacing ruby_setup with ruby_init as cremno suggested. I'm not sure as to how far I could integrate such changes upstream though..

Ah, thanks for chiming in cremno, I was going to ask you :D Yeah, this mindset of ruby 1.9 that it's the main executable code and can just `exit()` on error is really problematic. I mean, you could probably still run games with it, but getting any decent error messages would be impossible, not to even speak of all the unreleased resources at the end. If you still want to go with 1.9, you might want to try commenting out the entire body of `showExc()` and replacing `ruby_setup` with `ruby_init` as cremno suggested. I'm not sure as to how far I could integrate such changes upstream though..
hanetzer commented 2014-06-27 22:04:25 +00:00 (Migrated from github.com)

@Ancurio Not really, I'm rather unexperienced with using cmake (I'm an autotools guy myself); its simply the fact that msys2 simply 'just works' regarding stuff packaged for it. Sets up a standard FSH in duplication of archlinux, good buildscripts for things that dont yet exist, its the closest thing I know of you can get in windows to using actual *nix without a virtualmachine/reboot.

@Ancurio Not really, I'm rather unexperienced with using cmake (I'm an autotools guy myself); its simply the fact that msys2 simply 'just works' regarding stuff packaged for it. Sets up a standard FSH in duplication of archlinux, good buildscripts for things that dont yet exist, its the closest thing I know of you can get in windows to using actual *nix without a virtualmachine/reboot.
hanetzer commented 2014-06-27 22:10:56 +00:00 (Migrated from github.com)

The main issue I had getting mkxp compiled against ruby-2.1.2 is a conflict with some posix macros conflicting from winpthreads and ruby; a patch to the former and commenting out of the latter and all was well.

The main issue I had getting mkxp compiled against ruby-2.1.2 is a conflict with some posix macros conflicting from winpthreads and ruby; a patch to the former and commenting out of the latter and all was well.
The-J-Person commented 2014-11-12 18:13:18 +00:00 (Migrated from github.com)

If it's working, could someone put up a windows binary pack? It would be especially useful for packing games with a custom soundfont and fluidsynth for a similar MIDI experience across all systems.

If it's working, could someone put up a windows binary pack? It would be especially useful for packing games with a custom soundfont and fluidsynth for a similar MIDI experience across all systems.
hanetzer commented 2014-11-13 16:11:53 +00:00 (Migrated from github.com)

I'd have to recompile, the version I worked together was prior to the MIDI inclusion. Currently I'm working 6-7 12 hour shifts a night and studying for my CompTIA A+ cert exam, so my spare time for this sort of thing is rather scarce.

I'd have to recompile, the version I worked together was prior to the MIDI inclusion. Currently I'm working 6-7 12 hour shifts a night and studying for my CompTIA A+ cert exam, so my spare time for this sort of thing is rather scarce.
Ancurio commented 2014-11-13 16:27:49 +00:00 (Migrated from github.com)

@ntzrmtthihu777

In case you do find the time, it shouldn't be very difficult as the dependencies between back then and now didn't change at all I believe.

@ntzrmtthihu777 In case you do find the time, it shouldn't be very difficult as the dependencies between back then and now didn't change at all I believe.
hanetzer commented 2014-11-13 16:31:33 +00:00 (Migrated from github.com)

@Ancurio sup man. Yeah, I suppose so, though I do recall having severe issue getting fluidsynth to compile on windows (needs something from the direct* sdk, and I really don't wan't to download the entire thing [smartphone internet, 500mb 4g/month] for one header file...). Also, I never solved the issue of compiling it for windows without it opening a cmd.exe window when ran (did all the -Wl,-subsystem,windows crap in various forms. It 'runs' without opening the window, but immediatly goes into not responding mode). I assume it has something to do with the fuckery that SDL does to int main.

@Ancurio sup man. Yeah, I suppose so, though I do recall having severe issue getting fluidsynth to compile on windows (needs something from the direct\* sdk, and I really don't wan't to download the entire thing [smartphone internet, 500mb 4g/month] for one header file...). Also, I never solved the issue of compiling it for windows without it opening a cmd.exe window when ran (did all the -Wl,-subsystem,windows crap in various forms. It 'runs' without opening the window, but immediatly goes into not responding mode). I assume it has something to do with the fuckery that SDL does to int main.
Ancurio commented 2014-11-13 16:44:06 +00:00 (Migrated from github.com)

@ntzrmtthihu777 I see, no need to sweat it. I think in theory one could just download a random prebuilt fluidsynth.dll from the interwebs and it should work ok (you don't need the headers).

And yeah, that console window stuff was really unfortunate. I actually tried a cross compile with mingw today just for funzies, got all dependencies compiled pretty effortlessly except for boost which is a really strange beast with the weirdest build system on earth.

@ntzrmtthihu777 I see, no need to sweat it. I think in theory one could just download a random prebuilt fluidsynth.dll from the interwebs and it should work ok (you don't need the headers). And yeah, that console window stuff was really unfortunate. I actually tried a cross compile with mingw today just for funzies, got all dependencies compiled pretty effortlessly except for boost which is a really strange beast with the weirdest build system on earth.
hanetzer commented 2014-11-13 16:49:49 +00:00 (Migrated from github.com)

What distro are you on? Boost was not an issue on my end at all (BTW, I know you use it for Program Options, have you considered instead GNU GetOPT? What else is boost doing for you?)

What distro are you on? Boost was not an issue on my end at all (BTW, I know you use it for Program Options, have you considered instead GNU GetOPT? What else is boost doing for you?)
Ancurio commented 2014-11-13 16:56:46 +00:00 (Migrated from github.com)

I'm on Fedora (19). I think I'm just too stupid to read the boost documentation, no matter how I setup the config file it won't even start the build, maybe I'll get back to it some later time.

I actually also use the unordered hash and set containers from boost, but they're header only. Program options is kinda nice because it parses both config files (mkxp.conf) and command line arguments, and transparently merges them. There's a few games using mkxp on Steam right now, and it's really neat when players don't have to navigate folders and edit mkxp.conf (which might be overwritten by Steam) because I can just tell them to set a few launch parameters for the executable in the Steam settings instead.

I took a quick look at getopt, but it seems to do cmd line args parsing only?

Edit: Just noticed that my distro has prebuilt mingw packages for boost, awesome! Gonna give them a try.

I'm on Fedora (19). I think I'm just too stupid to read the boost documentation, no matter how I setup the config file it won't even start the build, maybe I'll get back to it some later time. I actually also use the unordered hash and set containers from boost, but they're header only. Program options is kinda nice because it parses both config files (mkxp.conf) and command line arguments, and transparently merges them. There's a few games using mkxp on Steam right now, and it's really neat when players don't have to navigate folders and edit mkxp.conf (which might be overwritten by Steam) because I can just tell them to set a few launch parameters for the executable in the Steam settings instead. I took a quick look at getopt, but it seems to do cmd line args parsing only? Edit: Just noticed that my distro has prebuilt mingw packages for boost, awesome! Gonna give them a try.
hanetzer commented 2014-11-13 17:38:16 +00:00 (Migrated from github.com)

AFAIK yes, getopt is command line only. I'm an Arch user myself, fully updated (even using the linux-git kernel 3.18-rc4) as of a few days ago.

AFAIK yes, getopt is command line only. I'm an Arch user myself, fully updated (even using the linux-git kernel 3.18-rc4) as of a few days ago.
Ancurio commented 2014-11-15 17:08:35 +00:00 (Migrated from github.com)

So, using the nice precompiled libs from the Fedora repos, I managed to link a mkxp.exe in the end. There's one problem (potential bug) in SDL2 that I have worked around for the time being, and for some reason jpeg decoding fails every time, but other than that, most things seems to work nicely (as far as I can tell). Testing is just really annoying because my WinXP VM doesn't do OpenGL 2.0, so I have to reboot into my Vista partition to actually run anything graphical.

Once I get the jpeg problem sorted out, I'll upload the binary if you want to play with it @The-J-Person, although I give no guarantees as to bugs, and probably won't be able to debug any further (and more intricate) problems ;D

So, using the nice precompiled libs from the Fedora repos, I managed to link a mkxp.exe in the end. There's one problem (potential bug) in SDL2 that I have worked around for the time being, and for some reason jpeg decoding fails every time, but other than that, most things seems to work nicely (as far as I can tell). Testing is just really annoying because my WinXP VM doesn't do OpenGL 2.0, so I have to reboot into my Vista partition to actually run anything graphical. Once I get the jpeg problem sorted out, I'll upload the binary if you want to play with it @The-J-Person, although I give no guarantees as to bugs, and probably won't be able to debug any further (and more intricate) problems ;D
The-J-Person commented 2014-11-15 22:19:56 +00:00 (Migrated from github.com)

Thanks a lot :D I actually use Debian and Mint myself, and normally use WINE to see if windows executables work rather than a VM - close enough methinks.

Really though, thank you for your hard work and responsiveness - it is much appreciated!

Thanks a lot :D I actually use Debian and Mint myself, and normally use WINE to see if windows executables work rather than a VM - close enough methinks. Really though, thank you for your hard work and responsiveness - it is much appreciated!
hanetzer commented 2014-11-16 20:54:14 +00:00 (Migrated from github.com)

@The-J-Person @Ancurio yeah, generally opengl based games tend to work very well under wine, my own mkxp.exe ran under wine fine, but upon using it in windows I still get the cmd.exe box... irksome.

@The-J-Person @Ancurio yeah, generally opengl based games tend to work very well under wine, my own mkxp.exe ran under wine fine, but upon using it in windows I still get the cmd.exe box... irksome.
Ancurio commented 2014-11-16 21:20:06 +00:00 (Migrated from github.com)

@ntzrmtthihu777 I think that's because wine just pipes through the raw OpenGL driver it finds on LInux (eg. GL_VENDOR and such still show Mesa even under wine). Btw. I can link my exe with -mwindows and it hides the cmd window just fine.. I'm using mingw-w64 btw., not sure if that's related.

Got the SDL2 and libjpeg issues sorted out properly, but now OpenAL is giving me huge troubles with its mmdevapi backend, hopefully I can make it always default to DirectSound because I have no clue what's going on haha. I really hope it's not related to me linking libOpenAL statically though.

@ntzrmtthihu777 I think that's because wine just pipes through the raw OpenGL driver it finds on LInux (eg. GL_VENDOR and such still show Mesa even under wine). Btw. I can link my exe with -mwindows and it hides the cmd window just fine.. I'm using mingw-w64 btw., not sure if that's related. Got the [SDL2](https://bugzilla.libsdl.org/show_bug.cgi?id=2786) and libjpeg issues sorted out properly, but now OpenAL is giving me huge troubles with its mmdevapi backend, hopefully I can make it always default to DirectSound because I have no clue what's going on haha. I really hope it's not related to me linking libOpenAL statically though.
hanetzer commented 2014-11-17 10:33:27 +00:00 (Migrated from github.com)

@Ancurio what steps did you take to compile and link mkxp for windows?

@Ancurio what steps did you take to compile and link mkxp for windows?
Ancurio commented 2014-11-17 11:15:16 +00:00 (Migrated from github.com)

@ntzrmtthihu777 Hmm, I'm not exactly sure what you mean? I compiled all .cpp's into .o's, then linked them with the libraries into an .exe. Here's my ad-hoc build script, maybe that will make more sense.

@The-J-Person Unfortunately I hit a wall that I couldn't further debug. To be more specific, I always compile two executables, one that opens a console window for output and one that doesn't, but for some reason the non-console-window one keeps segfaulting over and over without visible cause (console version works completely fine) on my Windows Vista system. Using wine or running it in my Windows XP WM, it works perfectly fine however, so I have no idea what's going wrong.

Here is the last build I made, please try it for yourself: https://www.dropbox.com/s/ugpkcz83zxebamh/mkxp-mingw32.zip?dl=0

@ntzrmtthihu777 Hmm, I'm not exactly sure what you mean? I compiled all .cpp's into .o's, then linked them with the libraries into an .exe. [Here's my ad-hoc build script](http://pastebin.com/sVd946mc), maybe that will make more sense. @The-J-Person Unfortunately I hit a wall that I couldn't further debug. To be more specific, I always compile two executables, one that opens a console window for output and one that doesn't, but for some reason the non-console-window one keeps segfaulting over and over without visible cause (console version works completely fine) on my Windows Vista system. Using wine or running it in my Windows XP WM, it works perfectly fine however, so I have no idea what's going wrong. Here is the last build I made, please try it for yourself: https://www.dropbox.com/s/ugpkcz83zxebamh/mkxp-mingw32.zip?dl=0
hanetzer commented 2014-11-17 20:40:56 +00:00 (Migrated from github.com)

@Ancurio ah, static linked it all? sounds like a plan, considering the tendancy of windows to get stuck in dll hell.

@Ancurio ah, static linked it all? sounds like a plan, considering the tendancy of windows to get stuck in dll hell.
Ancurio commented 2014-11-17 21:10:03 +00:00 (Migrated from github.com)

@ntzrmtthihu777 It's really just because Windows has no clean rpath equivalent. I usually prefer to dynamically link all my dependencies, and on Linux/OSX you can neatly stow them away into a lib subfolder and still have everything work, whereas windows leaves you no choice but to splatter a giant blob of dll's into the folder which just makes it very confusing for users to "find the executable to double click", that's why I prefer static linking there.

@ntzrmtthihu777 It's really just because Windows has no clean rpath equivalent. I usually prefer to dynamically link all my dependencies, and on Linux/OSX you can neatly stow them away into a lib subfolder and still have everything work, whereas windows leaves you no choice but to splatter a giant blob of dll's into the folder which just makes it very confusing for users to "find the executable to double click", that's why I prefer static linking there.
carstene1ns commented 2014-11-18 17:04:19 +00:00 (Migrated from github.com)

With a bit of initial work it would be possible to do that on windows, too. This method is similar to how isolated applications work.
Basically you need two manifest files, one will be embedded in the mkxp.exe or can stay in the same directory as mkxp.exe.manifest. This file references a local assembly, let's call it mkxplibs.
Then put all dlls (ruby, sdl,...) in a subfolder named mkxplibs and the second manifest as mkxplibs.manifest there, too. This file simply lists all needed dll names.
When windows loads the executable, it will first reference the assemblies and therefore will have all listed dlls available.


Reference, with example: http://sourceforge.net/p/mingw-w64/mailman/message/30019971/
How to add the manifest to the exe: http://cournape.wordpress.com/2008/09/02/how-to-embed-a-manifest-into-a-dll-with-mingw-tools-only/

With a bit of initial work it would be possible to do that on windows, too. This method is similar to how [isolated applications](http://msdn.microsoft.com/en-us/library/windows/desktop/aa375190%28v=vs.85%29.aspx) work. Basically you need two manifest files, one will be embedded in the `mkxp.exe` or can stay in the same directory as `mkxp.exe.manifest`. This file references a local assembly, let's call it `mkxplibs`. Then put all dlls (ruby, sdl,...) in a subfolder named `mkxplibs` and the second manifest as `mkxplibs.manifest` there, too. This file simply lists all needed dll names. When windows loads the executable, it will first reference the assemblies and therefore will have all listed dlls available. --- Reference, with example: http://sourceforge.net/p/mingw-w64/mailman/message/30019971/ How to add the manifest to the exe: http://cournape.wordpress.com/2008/09/02/how-to-embed-a-manifest-into-a-dll-with-mingw-tools-only/
Ancurio commented 2014-11-18 19:40:38 +00:00 (Migrated from github.com)

@carstene1ns Very interesting. I've heard about this mechanism but always thought it was only available to C# applications. Thanks for sharing!

@carstene1ns Very interesting. I've heard about this mechanism but always thought it was only available to C# applications. Thanks for sharing!
elizagamedev commented 2014-11-19 08:33:44 +00:00 (Migrated from github.com)

I'm actually getting the same problem--console version works, -mwindows causes instant crash. I've tried both using the binaries posted here and compiling it myself with shared libraries, same exact symptoms. If it's any help, using shared libraries revealed that the crash originates in the Ruby library.

I'm actually getting the same problem--console version works, -mwindows causes instant crash. I've tried both using the binaries posted here and compiling it myself with shared libraries, same exact symptoms. If it's any help, using shared libraries revealed that the crash originates in the Ruby library.
Ancurio commented 2014-11-19 10:35:43 +00:00 (Migrated from github.com)

@mathewv Yes, I tried making a debug build and using gdb on windows first. The crash happened in io.c when manipulating stdio fds, specifically fstat was returning a EBADF errno and then ruby crashed in rb_bug() although that call meant it would have terminated anyway. So I tried commenting out that check and recompiling ruby. The crash there stopped, but it continued to crash somewhere else, st_foreach or something really basic like that, and that's where I threw the towel in because I assumed something must be randomly overwriting and corrupting memory. And I really don't have the setup to run valgrind under windows.

@mathewv Yes, I tried making a debug build and using gdb on windows first. The crash happened [in io.c when manipulating stdio fds](https://github.com/ruby/ruby/blob/trunk/io.c#L206), specifically fstat was returning a EBADF errno and then ruby crashed in `rb_bug()` although that call meant it would have terminated anyway. So I tried commenting out that check and recompiling ruby. The crash there stopped, but it continued to crash somewhere else, `st_foreach` or something really basic like that, and that's where I threw the towel in because I assumed something must be randomly overwriting and corrupting memory. And I really don't have the setup to run valgrind under windows.
hanetzer commented 2014-11-19 15:10:10 +00:00 (Migrated from github.com)

Very interesting, if disheartening. @Ancurio I had been rubber-duckying with a co-worker and thought I had an idea, but I suppose in light of the above revelation that the bug was originating in ruby seems to kill that idea... BUT. Just in case, lemme express it. I'm currently cloning mkxp on my windows partition again, and gonna try something. The idea is mayhaps SDL + -mwindows does not play well with your printing of the various opengl infos onto a nonexistant console. Hope I'm not sounding too foolish suggesting that.

Very interesting, if disheartening. @Ancurio I had been rubber-duckying with a co-worker and thought I had an idea, but I suppose in light of the above revelation that the bug was originating in ruby seems to kill that idea... BUT. Just in case, lemme express it. I'm currently cloning mkxp on my windows partition again, and gonna try something. The idea is mayhaps SDL + -mwindows does not play well with your printing of the various opengl infos onto a nonexistant console. Hope I'm not sounding too foolish suggesting that.
hanetzer commented 2014-11-19 15:11:42 +00:00 (Migrated from github.com)

@Ancurio valgrind is a code checker of sorts, yes? Well I may have the setup to be able to do it, if you can guide me.

@Ancurio valgrind is a code checker of sorts, yes? Well I may have the setup to be able to do it, if you can guide me.
Ancurio commented 2014-11-19 16:15:25 +00:00 (Migrated from github.com)

@ntzrmtthihu777 It's not confirmed that the bug originates in ruby per se, just the symptoms always show up there, but who knows. When the first stdio issue I explained above came up, I did consider the possibility of the mwindows switch somehow causing the default file streams to be closed, but a. that doesn't make any sense and b. even then writing to a closed stream is an error condition and doesn't cause memory corruption, so that's out for me. Googling this also didn't reveal anything like a common problem.

When I said valgrind (which is a collection of tools) I specifically meant valgrind --tool=memcheck, which will print any use of unallocated memory. It's not like this would immediately reveal the error, but it's often the only way to even get close to it. Actually, reading the homepage, valgrind doesn't support windows at all haha, so nevermind that. There might be tools that do a similar job though.

Debugging problems like these can be arduous and take quite a bit of time, so I'd suggest to only do this if you have plenty of time and patience. I appreciate your will to help though.

@ntzrmtthihu777 It's not confirmed that the bug originates in ruby per se, just the symptoms always show up there, but who knows. When the first stdio issue I explained above came up, I did consider the possibility of the mwindows switch somehow causing the default file streams to be closed, but a. that doesn't make any sense and b. even then writing to a closed stream is an error condition and doesn't cause memory corruption, so that's out for me. Googling this also didn't reveal anything like a common problem. When I said valgrind (which is a collection of tools) I specifically meant `valgrind --tool=memcheck`, which will print any use of unallocated memory. It's not like this would immediately reveal the error, but it's often the only way to even get close to it. Actually, reading the homepage, valgrind doesn't support windows at all haha, so nevermind that. There might be tools that do a similar job though. Debugging problems like these can be arduous and take quite a bit of time, so I'd suggest to only do this if you have plenty of time and patience. I appreciate your will to help though.
hanetzer commented 2014-11-19 16:37:47 +00:00 (Migrated from github.com)

Patience I have in abundance, time not so much. So in what directory/etc should one use valgrind? oh, no windows support.... would loading it in a debugger meant for windows help? and should this be on a static-compiled or shared version of mkxp?

Patience I have in abundance, time not so much. So in what directory/etc should one use valgrind? oh, no windows support.... would loading it in a debugger meant for windows help? and should this be on a static-compiled or shared version of mkxp?
Ancurio commented 2014-11-19 16:49:34 +00:00 (Migrated from github.com)

I already ran it in gdb which showed me where the segfaults happened, but a debugger will not help you track down memory corruptions.

I already ran it in gdb which showed me where the segfaults happened, but a debugger will not help you track down memory corruptions.
hanetzer commented 2014-11-19 17:09:12 +00:00 (Migrated from github.com)

hrm... what a pain this has come to be. I'd rather avoid it, but I've been considering doing a rewrite with sfml (even if it does not feature all that mkxp on linux provides.)

hrm... what a pain this has come to be. I'd rather avoid it, but I've been considering doing a rewrite with sfml (even if it does not feature all that mkxp on linux provides.)
Ancurio commented 2014-11-19 17:47:02 +00:00 (Migrated from github.com)

hrm... what a pain this has come to be

Eh, it's not really much of a pain :D I went into the mingw compile thinking "how far can I get without any effort" and this is the line (for now). If someone is serious about running mkxp on Windows, they will have to do the hard work.

I'd rather avoid it, but I've been considering doing a rewrite with sfml (even if it does not feature all that mkxp on linux provides.)

Interesting, but that's not really related to this issue is it?

Fun fact: I originally started out writing mkxp using SFML in 2012, and already had a lot of stuff done, but I got so annoyed with SFML's limitations and inefficient code that I completely rewrote the graphics part in SDL+OpenGL (best decision ever). I'd be interested to hear what advantages you're hoping to get out of SFML =)

> hrm... what a pain this has come to be Eh, it's not really much of a pain :D I went into the mingw compile thinking "how far can I get without any effort" and this is the line (for now). If someone is serious about running mkxp on Windows, they will have to do the hard work. > I'd rather avoid it, but I've been considering doing a rewrite with sfml (even if it does not feature all that mkxp on linux provides.) Interesting, but that's not really related to this issue is it? Fun fact: I originally started out writing mkxp using SFML in 2012, and already had a lot of stuff done, but I got so annoyed with SFML's limitations and inefficient code that I completely rewrote the graphics part in SDL+OpenGL (best decision ever). I'd be interested to hear what advantages you're hoping to get out of SFML =)
elizagamedev commented 2014-11-19 20:51:37 +00:00 (Migrated from github.com)

Much to my surprise, I figured out a solution. It's not exactly pretty, but it stops the crashes on my Windows 7 VM.

Basically I redirected the standard input/output streams like this:

#if defined _WIN32 && defined NOCONSOLE
    freopen("NUL", "w", stdout);
    freopen("NUL", "w", stderr);
    freopen("NUL", "r", stdin);
#endif

I put the code before the ruby_setup() call in mriBindingExecute(). Then in mkxp.pro,

win32 {
    !console {
        DEFINES += NOCONSOLE
    }
}

I don't necessarily like it, but I like it a lot better than the program not working at all.

Much to my surprise, I figured out a solution. It's not exactly pretty, but it stops the crashes on my Windows 7 VM. Basically I redirected the standard input/output streams like this: ``` #if defined _WIN32 && defined NOCONSOLE freopen("NUL", "w", stdout); freopen("NUL", "w", stderr); freopen("NUL", "r", stdin); #endif ``` I put the code before the `ruby_setup()` call in `mriBindingExecute()`. Then in mkxp.pro, ``` win32 { !console { DEFINES += NOCONSOLE } } ``` I don't necessarily like it, but I like it a lot better than the program not working at all.
cremno commented 2014-11-19 21:16:31 +00:00 (Migrated from github.com)

It's crashing, because (at least on Windows) ruby_sysinit() needs to be called. Which does something similar to @mathewv's code. Also, see https://github.com/Ancurio/mkxp/issues/45#issuecomment-48457900. But I think my code is slightly wrong (argv needs to be initialized). It's a weird function anyway.

It's crashing, because (at least on Windows) `ruby_sysinit()` needs to be called. Which does something similar to @mathewv's code. Also, see https://github.com/Ancurio/mkxp/issues/45#issuecomment-48457900. But I think my code is slightly wrong (`argv` needs to be initialized). It's a weird function anyway.
Ancurio commented 2014-11-19 23:21:09 +00:00 (Migrated from github.com)

Thanks for chiming in @cremno. I feel a bit stupid actually, because my first idea when I saw the fstat problem too was "well, let's just reopen all the streams to null!", and already had the code written, but then deleted it instead thinking it wouldn't work if ruby used the fd values (0, 1, 2) directly.. oh well. And closing stdout before ruby_init on Linux also leads to a crash in the exact same location, so that's definitely the cause.

Do you know if it's safe to just init the argc and argv arguments to 0 or do I actually have to pass the real stuff along? (At least on windows, it looks like it just ignores them and does its own parsing via GetCommandLine())

Thanks for chiming in @cremno. I feel a bit stupid actually, because my first idea when I saw the fstat problem too was "well, let's just reopen all the streams to null!", and already had the code written, but then deleted it instead thinking it wouldn't work if ruby used the fd values (0, 1, 2) directly.. oh well. And closing stdout before ruby_init on Linux also leads to a crash in the exact same location, so that's definitely the cause. Do you know if it's safe to just init the argc and argv arguments to `0` or do I actually have to pass the real stuff along? (At least on windows, it looks like it just ignores them and does its own parsing via `GetCommandLine()`)
cremno commented 2014-11-19 23:43:14 +00:00 (Migrated from github.com)

Is passing the arguments from main() not an option? The argc argument doesn't seem to be used at the moment, but the argv one is used when a malloc() call fails (name is vec): 4cb3f72fdd/win32/win32.c (L1775-L1776)

Is passing the arguments from `main()` not an option? The `argc` argument doesn't seem to be used at the moment, but the `argv` one is used when a `malloc()` call fails (name is `vec`): https://github.com/ruby/ruby/blob/4cb3f72fddfbee1341b21a8ec7b82ae884dbd3c8/win32/win32.c#L1775-L1776
Ancurio commented 2014-11-20 00:19:04 +00:00 (Migrated from github.com)

Eh, there's like two million places that will crash / throw uncaught exceptions if malloc fails, so that's fine. I'm just trying to reduce the needed changes to as little as possible (passing the real args would cause line changes in a few unrelated places). Although I think argv[0] is available in shState because PhysFS needs it, so we could provide that if absolutely necessary (don't know why ruby code would want to see anything else).

Eh, there's like two million places that will crash / throw uncaught exceptions if malloc fails, so that's fine. I'm just trying to reduce the needed changes to as little as possible (passing the real args would cause line changes in a few unrelated places). Although I think argv[0] is available in shState because PhysFS needs it, so we could provide that if absolutely necessary (don't know why ruby code would want to see anything else).
cremno commented 2014-11-20 00:28:29 +00:00 (Migrated from github.com)

Well, then the code I've posted in the other issue should be fine.

Well, then the code I've posted in the other issue should be fine.
Ancurio commented 2014-11-20 01:02:16 +00:00 (Migrated from github.com)

Yup, just tested this, works fine under my Vista system too. Please try these new binaries @The-J-Person : https://www.dropbox.com/s/ugpkcz83zxebamh/mkxp-mingw32.zip?dl=0

I've also added in the random fluidsynth.dll I found via google.

Yup, just tested this, works fine under my Vista system too. Please try these new binaries @The-J-Person : https://www.dropbox.com/s/ugpkcz83zxebamh/mkxp-mingw32.zip?dl=0 I've also added in the random fluidsynth.dll I found via google.
hanetzer commented 2014-11-20 11:11:55 +00:00 (Migrated from github.com)

mainly that its pretty straight-forward with the console/no console bit, no wierd entry point manipulation. Plus, lot less libs on the windows side (though I suppose static linking them as you were would actually remove that concern.

mainly that its pretty straight-forward with the console/no console bit, no wierd entry point manipulation. Plus, lot less libs on the windows side (though I suppose static linking them as you were would actually remove that concern.
Ancurio commented 2014-11-20 11:34:48 +00:00 (Migrated from github.com)

mainly that its pretty straight-forward with the console/no console bit

More straightforward than a single linker flag? I don't know what's going wrong for you, but as you saw you're the only one having this problem

no wierd entry point manipulation

I don't know what this refers to.

lot less libs on the windows side

SFML bundles like half of its dependencies as static libraries, so you're already unknowingly statically compiling away half of them without realizing it.

> mainly that its pretty straight-forward with the console/no console bit More straightforward than a single linker flag? I don't know what's going wrong for you, but as you saw you're the only one having this problem > no wierd entry point manipulation I don't know what this refers to. > lot less libs on the windows side [SFML bundles](https://github.com/LaurentGomila/SFML/tree/master/extlibs/libs-msvc/x86) like half of its dependencies as static libraries, so you're already unknowingly statically compiling away half of them without realizing it.
hanetzer commented 2014-11-20 12:58:35 +00:00 (Migrated from github.com)

entry point manipulation; using sdl you have to use int main(int argc, char** argv) which gets overwritten with SDLmain.

Console/no-console; actually we've discovered the issue was a ruby/windows thing, correct? so I guess this is moot point. My thought was that SDLmain for windows did that funky WinMain stuff which mayhaps caused issue with the console output, but seems to not be the issue, correct? I'm honestly not terribly familiar with windows-specific coding, so when something that works on linux doesn't on windows I tend to just go damn you windows! and procede to gripe the rest of the day.

Hah, is that so. Once again, more of a linux guy, lol.

entry point manipulation; using sdl you have to use `int main(int argc, char** argv)` which gets overwritten with SDLmain. Console/no-console; actually we've discovered the issue was a ruby/windows thing, correct? so I guess this is moot point. My thought was that SDLmain for windows did that funky WinMain stuff which mayhaps caused issue with the console output, but seems to not be the issue, correct? I'm honestly not terribly familiar with windows-specific coding, so when something that works on linux doesn't on windows I tend to just go `damn you windows!` and procede to gripe the rest of the day. Hah, is that so. Once again, more of a linux guy, lol.
Ancurio commented 2014-11-20 13:41:45 +00:00 (Migrated from github.com)

entry point manipulation; using sdl you have to use int main(int argc, char** argv) which gets overwritten with SDLmain.

Oh, I see. I think that's because SDL wants to be called first even for console apps so it can verify correct initialization (grep for SDL_SetMainReady for details..), otherwise it wouldn't have to. Oh, and SFML does "that funky WinMain stuff" too. From my understanding, I think you have to have a WinMain entrypoint which serves the purpose of main on Windows if you want a real GUI app without console opening itself.

Console/no-console; actually we've discovered the issue was a ruby/windows thing, correct?

I think I misunderstood what you meant then. I thought you were referring to your problems in hiding the console window. The crashing on the non-console build was indeed a ruby/win32 interaction (although I'm still not sure who exactly closed the stdio streams O.o)

I'm honestly not terribly familiar with windows-specific coding, so when something that works on linux doesn't on windows I tend to just go damn you windows! and procede to gripe the rest of the day.

I know exactly what you mean, I had the same reaction when I gave up on the crashes earlier haha. I have close to zero experience with windows programming myself.

> entry point manipulation; using sdl you have to use int main(int argc, char*\* argv) which gets overwritten with SDLmain. Oh, I see. I think that's because SDL wants to be called first even for console apps so it can verify correct initialization (grep for `SDL_SetMainReady` for details..), otherwise it wouldn't have to. Oh, and [SFML does](https://github.com/LaurentGomila/SFML/blob/master/src/SFML/Main/MainWin32.cpp) "that funky WinMain stuff" too. From my understanding, I think you have to have a `WinMain` entrypoint which serves the purpose of `main` on Windows if you want a real GUI app without console opening itself. > Console/no-console; actually we've discovered the issue was a ruby/windows thing, correct? I think I misunderstood what you meant then. I thought you were referring to your problems in hiding the console window. The crashing on the non-console build was indeed a ruby/win32 interaction (although I'm still not sure who exactly closed the stdio streams O.o) > I'm honestly not terribly familiar with windows-specific coding, so when something that works on linux doesn't on windows I tend to just go `damn you windows!` and procede to gripe the rest of the day. I know exactly what you mean, I had the same reaction when I gave up on the crashes earlier haha. I have close to zero experience with windows programming myself.
hanetzer commented 2014-11-20 13:52:21 +00:00 (Migrated from github.com)

Nah. I've done a standard int main entry point with sfml on windows before, -mwindows'd it (or was it -Wl,-subsystem,windows or whatever it was?) and no problem, mayhaps the above flag does the WinMain bit.

Either way, I think we can say we've got this thing mostly filed away :) tried both of your new binaries on my windows partition and via wine, all is well.

Nah. I've done a standard `int main` entry point with sfml on windows before, `-mwindows`'d it (or was it `-Wl,-subsystem,windows` or whatever it was?) and no problem, mayhaps the above flag does the WinMain bit. Either way, I think we can say we've got this thing mostly filed away :) tried both of your new binaries on my windows partition and via wine, all is well.
Ancurio commented 2014-11-20 13:56:41 +00:00 (Migrated from github.com)

Pushed the crash fix: 33c571e691

Pushed the crash fix: 33c571e69147c8e0781ea870dd0f500fcd127385
hanetzer commented 2014-11-20 13:59:26 +00:00 (Migrated from github.com)

Excellent, now we just need a good buildscript for the windows side (either using mingw-w64 on linux or msys/mingw on windows) and we're golden.

Excellent, now we just need a good buildscript for the windows side (either using mingw-w64 on linux or msys/mingw on windows) and we're golden.
hanetzer commented 2014-11-20 20:50:34 +00:00 (Migrated from github.com)

@Ancurio hey, found your issue https://www.ruby-forum.com/topic/6182196 while googling about for info on how one would overcome some issues in cross-compiling ruby for windows on linux (the last supported version of mingw-w64-ruby on arch linux was 2.0.0_p247, and that simply was not good enough for me). I've since fixed up a PKGBUILD for mingw-w64-ruby 2.1.5, soon to be posted to the AUR for others to use. I don't know about how Fedora does its packaging, but all a PKGBUILD is is a collection of functions that automates the ./configure && make && make install or the equivalent, so you could manually use it as a recipe of sorts if you need :)

@Ancurio hey, found your issue https://www.ruby-forum.com/topic/6182196 while googling about for info on how one would overcome some issues in cross-compiling ruby for windows on linux (the last supported version of `mingw-w64-ruby` on arch linux was 2.0.0_p247, and that simply was not good enough for me). I've since fixed up a PKGBUILD for mingw-w64-ruby 2.1.5, soon to be posted to the AUR for others to use. I don't know about how Fedora does its packaging, but all a PKGBUILD is is a collection of functions that automates the `./configure && make && make install` or the equivalent, so you could manually use it as a recipe of sorts if you need :)
Ancurio commented 2014-11-20 21:31:44 +00:00 (Migrated from github.com)

So how did you tell configure to use your system installed ruby for generating the build files?

So how did you tell configure to use your system installed ruby for generating the build files?
hanetzer commented 2014-11-20 21:50:47 +00:00 (Migrated from github.com)

I didn't, I don't think. seems it all went very smoothly with no issue. All the fiddling I had to do was to deal with a bit of preprocessor macros

Here's the goods, see what you can see :) https://gist.github.com/ntzrmtthihu777/52423fb0691de108b093

I didn't, I don't think. seems it all went very smoothly with no issue. All the fiddling I had to do was to deal with a bit of preprocessor macros Here's the goods, see what you can see :) https://gist.github.com/ntzrmtthihu777/52423fb0691de108b093
hanetzer commented 2014-11-20 21:54:33 +00:00 (Migrated from github.com)

one problem I'm having using your win32_build.sh is I need a static gmp lib, but I'm having issue generating one...

one problem I'm having using your win32_build.sh is I need a static gmp lib, but I'm having issue generating one...
Ancurio commented 2014-11-20 22:13:41 +00:00 (Migrated from github.com)

Well, you're not really supposed to use that script, I only posted it to clarify how I'm building, but otherwise it's just a 10 minute hack job to get this done on my computer :D Of course if it works for you, thats cool.

I just downloaded the latest source code of GMP and compiled a static library without any problems. What is going wrong for you?

Well, you're not really supposed to use that script, I only posted it to clarify how I'm building, but otherwise it's just a 10 minute hack job to get this done on my computer :D Of course if it works for you, thats cool. I just downloaded the latest source code of GMP and compiled a static library without any problems. What is going wrong for you?
hanetzer commented 2014-11-20 22:15:51 +00:00 (Migrated from github.com)

probably something funky in the PKGBUILD for mingw-w64-gmp from the AUR, it just doesn't seem to create any static libs. Could you post a directory tree of what is produced on your end, please?

probably something funky in the PKGBUILD for mingw-w64-gmp from the AUR, it just doesn't seem to create any static libs. Could you post a directory tree of what is produced on your end, please?
Ancurio commented 2014-11-20 22:19:51 +00:00 (Migrated from github.com)
$ ls .libs/
libgmp.a  libgmp.la  libgmp.lai

The configure script mentioned that it cannot build both static and dynamic libraries at the same time, because the gmp.h for both is different.

``` $ ls .libs/ libgmp.a libgmp.la libgmp.lai ``` The configure script mentioned that it cannot build both static and dynamic libraries at the same time, because the `gmp.h` for both is different.
hanetzer commented 2014-11-20 22:22:52 +00:00 (Migrated from github.com)

yeah, I noticed that when I tried both at once XD
lemme check that out in a bit, I think I'll do some bull-hockery to make gmp.h an #ifdef switch between gmp_static.h and gmp_shared.h

yeah, I noticed that when I tried both at once XD lemme check that out in a bit, I think I'll do some bull-hockery to make gmp.h an #ifdef switch between gmp_static.h and gmp_shared.h
sorlok commented 2015-06-22 22:26:05 +00:00 (Migrated from github.com)

Hi all,

I've got most of the cross-compile working, but I'm having some trouble building both zlib and ruby. Does anyone have a set of commands handy that they used for these libraries?

Hi all, I've got most of the cross-compile working, but I'm having some trouble building both zlib and ruby. Does anyone have a set of commands handy that they used for these libraries?
elizagamedev commented 2015-06-22 22:29:18 +00:00 (Migrated from github.com)

I always use mxe (M Cross Environment) to cross-compile for Windows. It has a built-in script for compiling zlib, and it should make building Ruby easier (I think you might need to pass "--enable-shared --disable-static" or "--enable-static --disable-shared" to configure to get it to build a library, but I forget)

I always use mxe (M Cross Environment) to cross-compile for Windows. It has a built-in script for compiling zlib, and it should make building Ruby easier (I think you might need to pass "--enable-shared --disable-static" or "--enable-static --disable-shared" to configure to get it to build a library, but I forget)
sorlok commented 2015-06-28 21:34:35 +00:00 (Migrated from github.com)

@mathewv: Thanks for your advice, but after doing a clean build through MXE, I am running into the exact same kinds of errors when compiling ruby (zlib builds, but ruby doesn't find its symbols, and there are lots of scary-looking warnings.)

Does anyone who actually cross-compiled MKXP for Windows have time to do a quick overview of how they built ruby (with the zlib patches, of course)?

@mathewv: Thanks for your advice, but after doing a clean build through MXE, I am running into the exact same kinds of errors when compiling ruby (zlib builds, but ruby doesn't find its symbols, and there are lots of scary-looking warnings.) Does anyone who actually cross-compiled MKXP for Windows have time to do a quick overview of how they built ruby (with the zlib patches, of course)?
Ancurio commented 2015-06-28 21:55:38 +00:00 (Migrated from github.com)

@sorlok I haven't been able to convince the configure script to add -lz with mingw yet either. For now maybe just built Ruby without the zlib patch? Or does your game definitely require the module?

@sorlok I haven't been able to convince the configure script to add `-lz` with mingw yet either. For now maybe just built Ruby without the zlib patch? Or does your game definitely require the module?
sorlok commented 2015-06-28 22:15:27 +00:00 (Migrated from github.com)

@Ancurio Ah, ok, at least it's not just me. I think in the long run I'll just add the zlib files manually to the ruby source directory. For now, I'll try disabling zlib and seeing if I can work around the breakage in my game.

@Ancurio Ah, ok, at least it's not just me. I think in the long run I'll just add the zlib files manually to the ruby source directory. For now, I'll try disabling zlib and seeing if I can work around the breakage in my game.
DerVVulfman commented 2015-08-06 03:25:35 +00:00 (Migrated from github.com)

Last year, my colleague and friend ntzrmtthihu777 stated both:
But, then again I do have a pretty beefy cpu, AMD FX-6300 hex core @ 3.5ghz.
and
On another note, from your vsync comment, I set that to true in mkxp.conf and it yealded a perfectly playable game running at 60fps, though I think the original RPG Maker XP Game.exe ran at 40fps or so. But I suspect that's another of those 'sweeping it under the rug' things. In any case.

Running on Windows 7, I too had it running on 60FPS.However, upgrading my PC to a beefy i5 with Windows 8, the FPS was cut down to nearly half. It's now running at 32FPS at the most. Any clues? Oh, its the same .exe we used this past year when you last talked to ntz about the framerate.

Last year, my colleague and friend ntzrmtthihu777 stated both: But, then again I do have a pretty beefy cpu, AMD FX-6300 hex core @ 3.5ghz. and On another note, from your vsync comment, I set that to true in mkxp.conf and it yealded a perfectly playable game running at 60fps, though I think the original RPG Maker XP Game.exe ran at 40fps or so. But I suspect that's another of those 'sweeping it under the rug' things. In any case. Running on Windows 7, I too had it running on 60FPS.However, upgrading my PC to a beefy i5 with Windows 8, the FPS was cut down to nearly half. It's now running at 32FPS at the most. Any clues? Oh, its the same .exe we used this past year when you last talked to ntz about the framerate.
Ancurio commented 2015-08-06 17:45:07 +00:00 (Migrated from github.com)

@DerVVulfman The default framerate is defined by the RGSS version, but RPG Maker XP has no problem running at 60FPS if it's instructed to do so.

Any clues?

Your PC changed. The executable stayed the same. Update your drivers.

@DerVVulfman The default framerate is defined by the RGSS version, but RPG Maker XP has no problem running at 60FPS if it's instructed to do so. > Any clues? Your PC changed. The executable stayed the same. Update your drivers.
hanetzer commented 2017-02-28 08:57:31 +00:00 (Migrated from github.com)

Hey, @Ancurio its me again. Was hoping to discuss some things with you regarding this again, do you have somewhere we can talk live-ish? Basically looking to patch mkxp up a bit for some additional features a friend needs and build a windows version. I see you're hosting precompiled builds, was hoping you'd share the build setup.

Hey, @Ancurio its me again. Was hoping to discuss some things with you regarding this again, do you have somewhere we can talk live-ish? Basically looking to patch mkxp up a bit for some additional features a friend needs and build a windows version. I see you're hosting precompiled builds, was hoping you'd share the build setup.
khkramer commented 2017-02-28 11:48:47 +00:00 (Migrated from github.com)

I would be interested in that as well, I'm currently using Msys2 and it's working just fine however I have to put the dll of every single dependency in the folder as well (which are a lot) and haven't succeeded at a static build yet.

I would be interested in that as well, I'm currently using Msys2 and it's working just fine however I have to put the dll of every single dependency in the folder as well (which are a lot) and haven't succeeded at a static build yet.
hanetzer commented 2017-02-28 12:51:01 +00:00 (Migrated from github.com)

@khkramer I'm currently working on setting up a gentoo/crossdev toolchain
for this purpose. Certain
things are fighting me, but I think I've almost got it to a point of being
workable for general usage.
Most of the problems are from packages that honestly are probably not
needed within a given sysroot
for cross-compilation (no need to install, say, coreutils to
/usr/i686-w64-mingw32 for example).

On Tue, Feb 28, 2017 at 5:48 AM, khkramer notifications@github.com wrote:

I would be interested in that as well, I'm currently using Msys2 and it's
working just fine however I have to put the dll of every single dependency
in the folder as well (which are a lot) and haven't succeeded at a static
build yet.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Ancurio/mkxp/issues/35#issuecomment-283018888, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACofxbJ4_AP7foWERnz4AZWzmNFUeuswks5rhAmggaJpZM4CCJ0d
.

--
If you're looking towards the Son, all your shadows are behind you.

@khkramer I'm currently working on setting up a gentoo/crossdev toolchain for this purpose. Certain things are fighting me, but I think I've almost got it to a point of being workable for general usage. Most of the problems are from packages that honestly are probably not needed within a given sysroot for cross-compilation (no need to install, say, coreutils to `/usr/i686-w64-mingw32` for example). On Tue, Feb 28, 2017 at 5:48 AM, khkramer <notifications@github.com> wrote: > I would be interested in that as well, I'm currently using Msys2 and it's > working just fine however I have to put the dll of every single dependency > in the folder as well (which are a lot) and haven't succeeded at a static > build yet. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/Ancurio/mkxp/issues/35#issuecomment-283018888>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/ACofxbJ4_AP7foWERnz4AZWzmNFUeuswks5rhAmggaJpZM4CCJ0d> > . > -- If you're looking towards the Son, all your shadows are behind you.
sorlok commented 2017-02-28 13:55:30 +00:00 (Migrated from github.com)

@ntzrmtthihu777 I'll also share my build steps, which use a MXE cross-compilation setup on Linux:
https://docs.google.com/document/d/1G2SgTy2Ff76B6IO-w6mBLvO1NyThqmvM8TkTdl71JAQ/edit?usp=sharing

Warning: notes are very scatter-brained. I'm happy to answer questions as needed.

@ntzrmtthihu777 I'll also share my build steps, which use a MXE cross-compilation setup on Linux: https://docs.google.com/document/d/1G2SgTy2Ff76B6IO-w6mBLvO1NyThqmvM8TkTdl71JAQ/edit?usp=sharing Warning: notes are very scatter-brained. I'm happy to answer questions as needed.
hanetzer commented 2017-02-28 14:35:03 +00:00 (Migrated from github.com)

@sorlok does this result in a single static binary on windows? Or at least
close to it?

@sorlok does this result in a single static binary on windows? Or at least close to it?
Ancurio commented 2017-02-28 15:09:32 +00:00 (Migrated from github.com)

@ntzrmtthihu777 I use Telegram for instant messaging; we can talk over IRC too but then we'd have to arrange a date and time.
My build setup is very bare-bones; a lot of libraries I don't even have to compile myself because Fedora's repos are so rich in mingw64 prebuilts. This is the script I previously used for building the statically linked binaries: http://pastebin.com/6Vc2KVbm

"sources" is just a bash file filling some variables with the filenames of all source files.

Some notes I kept on compiling dependencies with mingw: http://pastebin.com/aMB1rinV

I also had a couple auxiliary files, like "build_env":

MKXP_PREF="/some/path/mkxp/deps-win32"
PKG_CONFIG_PATH="$MKXP_PREF/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig"
PATH="$MKXP_PREF/bin:$PATH"
HOST="i686-w64-mingw32"

Note that it's been a loooong time since I last worked with this so my memory is a bit hazy, and I'm really short on time. If you need more infos / details, we can chat in a few weeks (assuming I get done with my projects til then).

@ntzrmtthihu777 I use Telegram for instant messaging; we can talk over IRC too but then we'd have to arrange a date and time. My build setup is very bare-bones; a lot of libraries I don't even have to compile myself because Fedora's repos are so rich in mingw64 prebuilts. This is the script I previously used for building the statically linked binaries: http://pastebin.com/6Vc2KVbm "sources" is just a bash file filling some variables with the filenames of all source files. Some notes I kept on compiling dependencies with mingw: http://pastebin.com/aMB1rinV I also had a couple auxiliary files, like "build_env": MKXP_PREF="/some/path/mkxp/deps-win32" PKG_CONFIG_PATH="$MKXP_PREF/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig" PATH="$MKXP_PREF/bin:$PATH" HOST="i686-w64-mingw32" Note that it's been a loooong time since I last worked with this so my memory is a bit hazy, and I'm really short on time. If you need more infos / details, we can chat in a few weeks (assuming I get done with my projects til then).
sorlok commented 2017-02-28 15:29:40 +00:00 (Migrated from github.com)

@ntzrmtthihu777: It results in everything static except OpenAL (and libgcc_s_sjlj on 32-bit for some reason). (Ancurio has managed to link OpenAL statically, but I never was able to do it.)

@ntzrmtthihu777: It results in everything static except OpenAL (and libgcc_s_sjlj on 32-bit for some reason). (Ancurio has managed to link OpenAL statically, but I never was able to do it.)
hanetzer commented 2017-03-01 02:07:16 +00:00 (Migrated from github.com)

@sorlok I may have misinterpreted your instructions on patching openal, as it would not build for me (x86_64, trying i686 now).

mxe/usr/x86_64-w64-mingw32.static/lib/libOpenAL32.a(mmdevapi.c.obj):mmdevapi.c:(.text+0x2a03): undefined reference to `__imp_CoCreateInstance'
mxe/usr/x86_64-w64-mingw32.static/lib/libOpenAL32.a(mmdevapi.c.obj):mmdevapi.c:(.text+0x2a2f): undefined reference to `__imp_CoUninitialize'
mxe/usr/x86_64-w64-mingw32.static/lib/libOpenAL32.a(mmdevapi.c.obj):mmdevapi.c:(.text+0x2af6): undefined reference to `__imp_CoUninitialize'
@sorlok I may have misinterpreted your instructions on patching openal, as it would not build for me (x86_64, trying i686 now). ```bash mxe/usr/x86_64-w64-mingw32.static/lib/libOpenAL32.a(mmdevapi.c.obj):mmdevapi.c:(.text+0x2a03): undefined reference to `__imp_CoCreateInstance' mxe/usr/x86_64-w64-mingw32.static/lib/libOpenAL32.a(mmdevapi.c.obj):mmdevapi.c:(.text+0x2a2f): undefined reference to `__imp_CoUninitialize' mxe/usr/x86_64-w64-mingw32.static/lib/libOpenAL32.a(mmdevapi.c.obj):mmdevapi.c:(.text+0x2af6): undefined reference to `__imp_CoUninitialize' ```
sorlok commented 2017-03-01 02:34:49 +00:00 (Migrated from github.com)

@ntzrmtthihu777 Yeah, I was never able to get OpenAL to build statically. It should build just fine as a .dll though.

@ntzrmtthihu777 Yeah, I was never able to get OpenAL to build statically. It should build just fine as a .dll though.
hanetzer commented 2017-03-01 03:03:17 +00:00 (Migrated from github.com)

@sorlok ah, I get it. ${CHOST}.shared You may want to consider making some patches that can be easily applied to the various tarballs and such :)

EDIT: just failed x86_64-w64-mingw32.shared openal. Do you think you could share your CMakeLists.txt for openal? I'm pretty sure I'm interpreting what you wrote wrong.

@sorlok ah, I get it. `${CHOST}.shared` You may want to consider making some patches that can be easily applied to the various tarballs and such :) EDIT: just failed x86_64-w64-mingw32.shared openal. Do you think you could share your CMakeLists.txt for openal? I'm pretty sure I'm interpreting what you wrote wrong.
khkramer commented 2017-03-01 10:03:08 +00:00 (Migrated from github.com)

@sorlok I'll try adapting your build process soon.
I don't mind having a single DLL for OpenAL but at the moment I have like 20 Dll's, since SDL image also needs dll's for every single image format atm.

@sorlok I'll try adapting your build process soon. I don't mind having a single DLL for OpenAL but at the moment I have like 20 Dll's, since SDL image also needs dll's for every single image format atm.
hanetzer commented 2017-03-01 21:49:22 +00:00 (Migrated from github.com)

@sorlok seriously, if you could share your openal cmakelists.txt file I'd really appreciate it.
Actually I got it to compile... now I'm stuck on SDL2. If you could have a chat with me at some point I'd be very grateful.

@sorlok seriously, if you could share your openal cmakelists.txt file I'd really appreciate it. Actually I got it to compile... now I'm stuck on SDL2. If you could have a chat with me at some point I'd be very grateful.
hanetzer commented 2017-03-02 15:03:57 +00:00 (Migrated from github.com)

@Ancurio so, using your ad-hoc build script, I managed to get most everything to work. Problem is, src/sprite.cpp doesn't know what M_PI is... I could maybe define it or sommat, but I'm wondering if there is a cleaner way to do it.

@Ancurio so, using your ad-hoc build script, I managed to get most everything to work. Problem is, src/sprite.cpp doesn't know what `M_PI` is... I could maybe define it or sommat, but I'm wondering if there is a cleaner way to do it.
hanetzer commented 2017-03-02 15:24:25 +00:00 (Migrated from github.com)

still stuck. passing -DM_PI=3.14..... lets build progress to the point of linking, but fails due to undefined references to modplug stuffs... I've even recompiled SDL_sound with --disable-modplug and --enable-modplug=no, really stuck here :/

and I'm a dummy. good now, compiles, but still requires a few dlls.

still stuck. passing -DM_PI=3.14..... lets build progress to the point of linking, but fails due to undefined references to modplug stuffs... I've even recompiled SDL_sound with --disable-modplug and --enable-modplug=no, really stuck here :/ and I'm a dummy. good now, compiles, but still requires a few dlls.
sorlok commented 2017-03-02 15:38:55 +00:00 (Migrated from github.com)

@ntzrmtthihu777 My apologies; I dropped out for a day and missed these messages. I'll copy my CMakeLists.txt file when I get back from work today.

@ntzrmtthihu777 My apologies; I dropped out for a day and missed these messages. I'll copy my CMakeLists.txt file when I get back from work today.
hanetzer commented 2017-03-02 15:45:31 +00:00 (Migrated from github.com)

@sorlok while I appreciate the offer, I just got a static compile to work using @Ancurio 's ad-hoc script.
Took a bit of debugging, but it all worked out in the end.
Ended up just setting up an archlinux chroot and using the mingw-w64 repo on sourceforge (some dude called ant32) and a few self-compiled PKGBUILDS.

@sorlok while I appreciate the offer, I _just_ got a static compile to work using @Ancurio 's ad-hoc script. Took a bit of debugging, but it all worked out in the end. Ended up just setting up an archlinux chroot and using the mingw-w64 repo on sourceforge (some dude called ant32) and a few self-compiled PKGBUILDS.
sorlok commented 2017-03-02 15:55:37 +00:00 (Migrated from github.com)

@ntzrmtthihu777 That's great! Are you still having the issue with SDL2?

@ntzrmtthihu777 That's great! Are you still having the issue with SDL2?
hanetzer commented 2017-03-02 16:33:43 +00:00 (Migrated from github.com)

Nope, got it all nice now. 64-bit mkxp that actually runs (in a vm, kinda fucky display [due to fake gpu I bet] but it runs). Will be setting up my laptop as a test bed for this stuff. My friend's gonna be so stoked.

Nope, got it all nice now. 64-bit mkxp that actually runs (in a vm, kinda fucky display [due to fake gpu I bet] but it runs). Will be setting up my laptop as a test bed for this stuff. My friend's gonna be so stoked.
sorlok commented 2017-03-02 19:04:25 +00:00 (Migrated from github.com)

@ntzrmtthihu777 That's great, glad to hear it!

@ntzrmtthihu777 That's great, glad to hear it!
hanetzer commented 2017-03-04 06:56:18 +00:00 (Migrated from github.com)

@Ancurio I have some fresh builds for windows. 32 and 64 bit, iff'n you wanna stick them up somewhere.

@Ancurio I have some fresh builds for windows. 32 and 64 bit, iff'n you wanna stick them up somewhere.
openmac commented 2017-05-12 20:02:02 +00:00 (Migrated from github.com)

@ntzrmtthihu777, I want to try something on Windows, can you please kindly make a new Windows build from the mkxp-abs repo?
https://github.com/Ancurio/mkxp-abs

@ntzrmtthihu777, I want to try something on Windows, can you please kindly make a new Windows build from the mkxp-abs repo? https://github.com/Ancurio/mkxp-abs
hanetzer commented 2017-05-12 20:08:43 +00:00 (Migrated from github.com)

Sure, you just need a binary, right?

On Fri, May 12, 2017 at 3:02 PM, Ali Rastegar notifications@github.com
wrote:

@ntzrmtthihu777 https://github.com/ntzrmtthihu777, I want to try
something on Windows, can you please kindly make a new Windows build from
the mkxp-abs repo?
https://github.com/Ancurio/mkxp-abs


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Ancurio/mkxp/issues/35#issuecomment-301172452, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACofxVppfEOxUwYAP9foajug5MyviA8Zks5r5Lq9gaJpZM4CCJ0d
.

--
If you're looking towards the Son, all your shadows are behind you.

Sure, you just need a binary, right? On Fri, May 12, 2017 at 3:02 PM, Ali Rastegar <notifications@github.com> wrote: > @ntzrmtthihu777 <https://github.com/ntzrmtthihu777>, I want to try > something on Windows, can you please kindly make a new Windows build from > the mkxp-abs repo? > https://github.com/Ancurio/mkxp-abs > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/Ancurio/mkxp/issues/35#issuecomment-301172452>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/ACofxVppfEOxUwYAP9foajug5MyviA8Zks5r5Lq9gaJpZM4CCJ0d> > . > -- If you're looking towards the Son, all your shadows are behind you.
openmac commented 2017-05-12 20:10:16 +00:00 (Migrated from github.com)

Thanks!
If the binary has the libs in a static form then yes, but if the libs are dynamically loaded I would be grateful if you include them too.

Thanks! If the binary has the libs in a static form then yes, but if the libs are dynamically loaded I would be grateful if you include them too.
hanetzer commented 2017-05-12 20:43:28 +00:00 (Migrated from github.com)

Sure, no problem. I can't make a dynamic loaded mkxp with my current setup
(openal only builds shared or static, not both)
so it will be one static binary. Is there any major differences between it
and the mainline mkxp repo?

On Fri, May 12, 2017 at 3:10 PM, Ali Rastegar notifications@github.com
wrote:

Thanks!
If the binary has the libs in a static form then yes, but if the libs are
dynamically loaded I would be grateful if you include them too.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Ancurio/mkxp/issues/35#issuecomment-301174186, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACofxRNVqMSWIVoFPsaPqHqfVMJC819Gks5r5LyogaJpZM4CCJ0d
.

--
If you're looking towards the Son, all your shadows are behind you.

Sure, no problem. I can't make a dynamic loaded mkxp with my current setup (openal only builds shared or static, not both) so it will be one static binary. Is there any major differences between it and the mainline mkxp repo? On Fri, May 12, 2017 at 3:10 PM, Ali Rastegar <notifications@github.com> wrote: > Thanks! > If the binary has the libs in a static form then yes, but if the libs are > dynamically loaded I would be grateful if you include them too. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/Ancurio/mkxp/issues/35#issuecomment-301174186>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/ACofxRNVqMSWIVoFPsaPqHqfVMJC819Gks5r5LyogaJpZM4CCJ0d> > . > -- If you're looking towards the Son, all your shadows are behind you.
openmac commented 2017-05-12 20:47:37 +00:00 (Migrated from github.com)

Static will be great actually.
Hmm, steamshim support should be one of the most noticeable differences.

Static will be great actually. Hmm, steamshim support should be one of the most noticeable differences.
hanetzer commented 2017-05-12 20:56:04 +00:00 (Migrated from github.com)

Ah, cool. I'm currently at work away from my box, so it will be a bit
before I can do so. Do I need anything extra for steamshim
compilation, or is all that's needed in your repo?

On Fri, May 12, 2017 at 3:47 PM, Ali Rastegar notifications@github.com
wrote:

Static will be great actually.
Hmm, steamshim support should be one of the most noticeable differences.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Ancurio/mkxp/issues/35#issuecomment-301182279, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACofxeaTPak3RrkkIwhC1izrTD66XcYgks5r5MVvgaJpZM4CCJ0d
.

--
If you're looking towards the Son, all your shadows are behind you.

Ah, cool. I'm currently at work away from my box, so it will be a bit before I can do so. Do I need anything extra for steamshim compilation, or is all that's needed in your repo? On Fri, May 12, 2017 at 3:47 PM, Ali Rastegar <notifications@github.com> wrote: > Static will be great actually. > Hmm, steamshim support should be one of the most noticeable differences. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/Ancurio/mkxp/issues/35#issuecomment-301182279>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/ACofxeaTPak3RrkkIwhC1izrTD66XcYgks5r5MVvgaJpZM4CCJ0d> > . > -- If you're looking towards the Son, all your shadows are behind you.
openmac commented 2017-05-12 21:08:35 +00:00 (Migrated from github.com)

Thanks, I really appreciate it.
The repo only includes the steamshim support for mkxp and in my experience with building on OS X it didn't need any other lib (it does not compile the steamshim_parent itself, I have to cross compile that one using the Steam SDK later).

Thanks, I really appreciate it. The repo only includes the steamshim support for mkxp and in my experience with building on OS X it didn't need any other lib (it does not compile the steamshim_parent itself, I have to cross compile that one using the Steam SDK later).
hanetzer commented 2017-05-13 00:59:01 +00:00 (Migrated from github.com)

@openmac 32/64 bit?
Also, it may be useful for you to merge in the changes from the main repo for the windows icon stuff.
Something seems to be wrong with mkxp-abs, in that the same makefile I use for the mainline mkxp repo
can't find SDL_main when linking SDLmain.a into it.

@openmac 32/64 bit? Also, it may be useful for you to merge in the changes from the main repo for the windows icon stuff. Something seems to be wrong with mkxp-abs, in that the same makefile I use for the mainline mkxp repo can't find SDL_main when linking SDLmain.a into it.
openmac commented 2017-05-13 05:27:09 +00:00 (Migrated from github.com)

Either of 32 or 64 bit is fine, I want to test it a while before figuring out how to make my own builds.
As for SDL_main, that's strange, if it is giving you too much trouble I still can benefit from testing with a build from a mainline mkxp repo too if that one builds as expected for you.

Either of 32 or 64 bit is fine, I want to test it a while before figuring out how to make my own builds. As for SDL_main, that's strange, if it is giving you too much trouble I still can benefit from testing with a build from a mainline mkxp repo too if that one builds as expected for you.
hanetzer commented 2017-05-13 07:52:40 +00:00 (Migrated from github.com)

@openmac no, seems like my arch chroot is busted for mingw-w64. pulling head on both repos results in the same error. I apologize for the delay, but I'm gonna go ahead and setup gentoo's crossdev and use that, which could take a while, but its becoming too much of a pain to maintain two distros.

@openmac no, seems like my arch chroot is busted for mingw-w64. pulling head on both repos results in the same error. I apologize for the delay, but I'm gonna go ahead and setup gentoo's crossdev and use that, which could take a while, but its becoming too much of a pain to maintain two distros.
openmac commented 2017-05-13 11:12:39 +00:00 (Migrated from github.com)

Sorry for all the trouble, there is absolutely no rush.

Sorry for all the trouble, there is absolutely no rush.
hanetzer commented 2017-05-23 01:26:55 +00:00 (Migrated from github.com)

@Ancurio yo, been working on tweaking cmake to be able to build for windows (not specifically on windows, mind you. I don't have the willpower to sort out that mess) and I was wondering if you had any particular preference as to how its done.

Considering its relatively easier to produce a fat, static linked mkxp.exe for windows rather than managing that whole side-by-side assemblies thing mentioned above, I'd basically have to replace target_link_libraries ${LIBRARY}_LIBRARIES with ${LIBRARY}_STATIC_LIBRARIES in an if(WIN32) block of some sort.

Barring that approach, I could look into making something like PostBuildMacBundle which would copy needed libraries into a subdir along with the manifest needed to use them (I've mostly figured out using windres from binutils with cmake, actually fairly simple).

Suggestions? Ideas?

@Ancurio yo, been working on tweaking cmake to be able to build for windows (not specifically *on* windows, mind you. I don't have the willpower to sort out that mess) and I was wondering if you had any particular preference as to _how_ its done. Considering its relatively easier to produce a fat, static linked mkxp.exe for windows rather than managing that whole side-by-side assemblies thing mentioned above, I'd basically have to replace `target_link_libraries ${LIBRARY}_LIBRARIES` with `${LIBRARY}_STATIC_LIBRARIES` in an `if(WIN32)` block of some sort. Barring that approach, I could look into making something like `PostBuildMacBundle` which would copy needed libraries into a subdir along with the manifest needed to use them (I've mostly figured out using windres from binutils with cmake, actually fairly simple). Suggestions? Ideas?
Ancurio commented 2017-05-23 18:01:08 +00:00 (Migrated from github.com)

@ntzrmtthihu777 I don't have a preference; if the OSX path in CMakeLists.txt copies over the libs to form the bundle, you can do the same for windows. A fat statically linked mkxp.exe is fine too, but in that case everything should be linked (except maybe fluidsynth).

@ntzrmtthihu777 I don't have a preference; if the OSX path in CMakeLists.txt copies over the libs to form the bundle, you can do the same for windows. A fat statically linked mkxp.exe is fine too, but in that case everything should be linked (except maybe fluidsynth).
hanetzer commented 2017-05-23 18:09:31 +00:00 (Migrated from github.com)

@Ancurio actually I had a question regarding the whole fluidsynth/fluidlite
thing; think it would be too much of a problem to add in some #ifdef's to
easily allow someone to build against either instead.

On Tue, May 23, 2017 at 1:01 PM, Jonas Kulla notifications@github.com
wrote:

@ntzrmtthihu777 https://github.com/ntzrmtthihu777 I don't have a
preference; if the OSX path in CMakeLists.txt copies over the libs to form
the bundle, you can do the same for windows. A fat statically linked
mkxp.exe is fine too, but in that case everything should be linked (except
maybe fluidsynth).


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Ancurio/mkxp/issues/35#issuecomment-303482990, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACofxZP8OxDa3dhf8x3nIbE6SgvZuuUZks5r8x7lgaJpZM4CCJ0d
.

--
If you're looking towards the Son, all your shadows are behind you.

@Ancurio actually I had a question regarding the whole fluidsynth/fluidlite thing; think it would be too much of a problem to add in some #ifdef's to easily allow someone to build against either instead. On Tue, May 23, 2017 at 1:01 PM, Jonas Kulla <notifications@github.com> wrote: > @ntzrmtthihu777 <https://github.com/ntzrmtthihu777> I don't have a > preference; if the OSX path in CMakeLists.txt copies over the libs to form > the bundle, you can do the same for windows. A fat statically linked > mkxp.exe is fine too, but in that case everything should be linked (except > maybe fluidsynth). > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/Ancurio/mkxp/issues/35#issuecomment-303482990>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/ACofxZP8OxDa3dhf8x3nIbE6SgvZuuUZks5r8x7lgaJpZM4CCJ0d> > . > -- If you're looking towards the Son, all your shadows are behind you.
Ancurio commented 2017-05-24 05:30:29 +00:00 (Migrated from github.com)

@ntzrmtthihu777 They have identical APIs.

@ntzrmtthihu777 They have identical APIs.
hanetzer commented 2017-05-24 05:32:55 +00:00 (Migrated from github.com)

@Ancurio yes, identical apis, but not identical header/pkgconfig files.

On Wed, May 24, 2017 at 12:30 AM, Jonas Kulla notifications@github.com
wrote:

@ntzrmtthihu777 https://github.com/ntzrmtthihu777 They have identical
APIs.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Ancurio/mkxp/issues/35#issuecomment-303621736, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACofxSFyGqxh5lzr-V2uE4KkIoW6Rx9Mks5r88B2gaJpZM4CCJ0d
.

--
If you're looking towards the Son, all your shadows are behind you.

@Ancurio yes, identical apis, but not identical header/pkgconfig files. On Wed, May 24, 2017 at 12:30 AM, Jonas Kulla <notifications@github.com> wrote: > @ntzrmtthihu777 <https://github.com/ntzrmtthihu777> They have identical > APIs. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/Ancurio/mkxp/issues/35#issuecomment-303621736>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/ACofxSFyGqxh5lzr-V2uE4KkIoW6Rx9Mks5r88B2gaJpZM4CCJ0d> > . > -- If you're looking towards the Son, all your shadows are behind you.
hanetzer commented 2017-05-25 06:38:47 +00:00 (Migrated from github.com)

I've managed to get cmake to build it, but there are some adjustments that I think are a bit unfortunate and very hackish that are needed. for whatever reason I need to #undef main to link, and add flac, ogg, and speex to the libraries (which I think is due to the lack of being able to make a shared SDL_sound.dll build on mingw-w64). Obviously this should not be part of the upstream repo, as it is a massive hack.

I've managed to get cmake to build it, but there are some adjustments that I think are a bit unfortunate and very hackish that are needed. for whatever reason I need to `#undef main` to link, and add flac, ogg, and speex to the libraries (which I think is due to the lack of being able to make a shared SDL_sound.dll build on mingw-w64). Obviously this should not be part of the upstream repo, as it is a massive hack.
Ancurio commented 2017-05-26 06:11:49 +00:00 (Migrated from github.com)

@ntzrmtthihu777 Regarding fluidsynth/fluidlite; this only concerns the build setting where you hard-link (instead of dlsym'ing) against the library, which is off by default. I feel ambivalent about this, because the normal fluidsynth dev packages you can download from every repository, whereas I'm not so sure how well fluidlite has been taken up by packagers. But then again, lots of other things don't make sense in mkxp either.

Feel free to send a PR that switches the respective pkg-config names to target fluidlite.

@ntzrmtthihu777 Regarding fluidsynth/fluidlite; this only concerns the build setting where you hard-link (instead of dlsym'ing) against the library, which is off by default. I feel ambivalent about this, because the normal fluidsynth dev packages you can download from every repository, whereas I'm not so sure how well fluidlite has been taken up by packagers. But then again, lots of other things don't make sense in mkxp either. Feel free to send a PR that switches the respective pkg-config names to target fluidlite.
hanetzer commented 2017-05-26 06:55:19 +00:00 (Migrated from github.com)

Agreeable in general, for sure, but if one is going to use fluidlite instead of fluidsynth, it makes more sense to do a hard-link, otherwise you need vorbis/others in the same dir as fluidlite.dll (and the side-dir, if you use that side-by-side assemblies technique discussed way back in the thread). On another note, with regards to the whole winmain issue with a cmake build, how would you feel about an ifdef'd undef main for windows? Yeah, its an ugly hack, but, you do get all the niceness of using cmake to build instead of an ugly script/makefile that got threw together, and its 'good enough' for now...

Also, I'm working on packaging fluidlite for gentoo at least, and possibly arch.

Agreeable in general, for sure, but if one is going to use fluidlite instead of fluidsynth, it makes more sense to do a hard-link, otherwise you need vorbis/others in the same dir as fluidlite.dll (and the side-dir, if you use that side-by-side assemblies technique discussed way back in the thread). On another note, with regards to the whole winmain issue with a cmake build, how would you feel about an ifdef'd undef main for windows? Yeah, its an ugly hack, but, you do get all the niceness of using cmake to build instead of an ugly script/makefile that got threw together, and its 'good enough' for now... Also, I'm working on packaging fluidlite for gentoo at least, and possibly arch.
hanetzer commented 2017-06-03 04:59:40 +00:00 (Migrated from github.com)

@Ancurio I've figured a bit more out. I think my SDL2 install is busted on the windows side, however, so more work needs to be done there. But, I've discovered a bit of a hack that at least lets mkxp compile and link via cmake cross-compilation.

Basically, running make VERBOSE=1 will reveal the final link command to be

/usr/bin/x86_64-w64-mingw32-g++ --sysroot=/usr/x86_64-w64-mingw32/   -mwindows -Wl,--whole-archive CMakeFiles/mkxp.dir/objects.a -Wl,--no-whole-archive  -o mkxp.exe -Wl,--out-implib,libmkxp.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/mkxp.dir/linklibs.rsp

with linklibs.rsp containing the following

-L/usr/lib -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lmingw32 -lSDL2main -lSDL2 -lSDL2_ttf -lmingw32 -lSDL2main -lSDL2 -lSDL_sound -lmingw32 -lSDL2main -lSDL2 -lsigc-2.0 -lphysfs -lpixman-1 /usr/x86_64-w64-mingw32/usr/lib/libboost_program_options-mt.dll -lruby24 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lvorbisfile /usr/x86_64-w64-mingw32/usr/lib/libOpenAL32.dll.a /usr/x86_64-w64-mingw32/usr/lib/libz.dll.a -lSDL2_image -lSDL2_ttf -lSDL_sound -lsigc-2.0 -lphysfs -lpixman-1 /usr/x86_64-w64-mingw32/usr/lib/libboost_program_options-mt.dll -lruby24 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lvorbisfile /usr/x86_64-w64-mingw32/usr/lib/libOpenAL32.dll.a /usr/x86_64-w64-mingw32/usr/lib/libz.dll.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32

Copying that file, editing the first bit to say -L/usr/x86_64-w64-mingw32/usr/lib and rerunning the g++ command with @newlinklib.rsp instead does link and compile it properly.

I've tried various methods of shoe-horning that directory into the link command in a more integrated fashion, such as the EXTERNAL_LIB_DIR variable you set up, to no avail. If we were able to get that to work somehow, I feel confident that this would work properly.

@Ancurio I've figured a bit more out. I think my SDL2 install is busted on the windows side, however, so more work needs to be done there. But, I've discovered a bit of a hack that at least lets mkxp compile and link via cmake cross-compilation. Basically, running `make VERBOSE=1` will reveal the final link command to be ``` /usr/bin/x86_64-w64-mingw32-g++ --sysroot=/usr/x86_64-w64-mingw32/ -mwindows -Wl,--whole-archive CMakeFiles/mkxp.dir/objects.a -Wl,--no-whole-archive -o mkxp.exe -Wl,--out-implib,libmkxp.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/mkxp.dir/linklibs.rsp ``` with linklibs.rsp containing the following ``` -L/usr/lib -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lmingw32 -lSDL2main -lSDL2 -lSDL2_ttf -lmingw32 -lSDL2main -lSDL2 -lSDL_sound -lmingw32 -lSDL2main -lSDL2 -lsigc-2.0 -lphysfs -lpixman-1 /usr/x86_64-w64-mingw32/usr/lib/libboost_program_options-mt.dll -lruby24 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lvorbisfile /usr/x86_64-w64-mingw32/usr/lib/libOpenAL32.dll.a /usr/x86_64-w64-mingw32/usr/lib/libz.dll.a -lSDL2_image -lSDL2_ttf -lSDL_sound -lsigc-2.0 -lphysfs -lpixman-1 /usr/x86_64-w64-mingw32/usr/lib/libboost_program_options-mt.dll -lruby24 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lvorbisfile /usr/x86_64-w64-mingw32/usr/lib/libOpenAL32.dll.a /usr/x86_64-w64-mingw32/usr/lib/libz.dll.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 ``` Copying that file, editing the first bit to say `-L/usr/x86_64-w64-mingw32/usr/lib` and rerunning the g++ command with `@newlinklib.rsp` instead does link and compile it properly. I've tried various methods of shoe-horning that directory into the link command in a more integrated fashion, such as the EXTERNAL_LIB_DIR variable you set up, to no avail. If we were able to get that to work somehow, I feel confident that this would work properly.
hanetzer commented 2017-07-13 12:30:33 +00:00 (Migrated from github.com)

@Ancurio so, I've worked out a build using meson that works for both linux and mingw-w64 cross-compile (have not tested running it yet, setting up a windows vm) but it does compile and link without error. I know you're a bit averse to the idea of adding new build systems, but this works very well, is very fast at building, and is relatively small (176 lines for meson.build, 5 lines for meson_options.txt, 15 lines each for x86_64 and i686 mingw-w64 cross-files) compared to the cmake build (443 lines).

What do you think? I've not yet a way to test builds on OSX, but meson apparently does handle/have instructions for it.

@Ancurio so, I've worked out a build using meson that works for both linux and mingw-w64 cross-compile (have not tested running it yet, setting up a windows vm) but it does compile and link without error. I know you're a bit averse to the idea of adding new build systems, but this works very well, is very fast at building, and is relatively small (176 lines for meson.build, 5 lines for meson_options.txt, 15 lines each for x86_64 and i686 mingw-w64 cross-files) compared to the cmake build (443 lines). What do you think? I've not yet a way to test builds on OSX, but meson apparently *does* handle/have instructions for it.
hanetzer commented 2017-07-16 18:51:44 +00:00 (Migrated from github.com)

@Ancurio good news! I figured out the error I was having (I don't think I discussed it with you, basically my toolchain was build with pie enabled and apparently that's a a bit fucky on mingw-w64, so even the simplest hello.exe wouldn't work unless it was compiled with -static), got a working meson.build setup for mkxp (tested in linux and mingw-w64, both amd64 build) which for windows uses the above listed side-by-side assemblies technique, putting the needed dlls into a runtime subdir of the game folder.

@Ancurio good news! I figured out the error I was having (I don't think I discussed it with you, basically my toolchain was build with pie enabled and apparently that's a a bit fucky on mingw-w64, so even the simplest hello.exe wouldn't work unless it was compiled with -static), got a working meson.build setup for mkxp (tested in linux and mingw-w64, both amd64 build) which for windows uses the above listed side-by-side assemblies technique, putting the needed dlls into a runtime subdir of the game folder.
Ancurio commented 2017-07-18 09:26:22 +00:00 (Migrated from github.com)

@ntzrmtthihu777 Can you open a new issue for this? This one is bursting at the seams already.

@ntzrmtthihu777 Can you open a new issue for this? This one is bursting at the seams already.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: MapleShrine/mkxp#35
No description provided.