blm768 / BulletD

An unfinished D binding for the Bullet Physics Engine
Boost Software License 1.0
11 stars 2 forks source link

Add Windows support #1

Open blm768 opened 11 years ago

blm768 commented 11 years ago

Windows support is currently lacking; we need to figure out how to resolve linking issues and hiccups with OPTLINK.

vuaru commented 11 years ago

[using MinGW to compile]

After neutering test.d of its struct literal issues (see other issue), it fully compiles.

A minor remaining issue is that the resulting exe wants both libgcc_s_dw2-1.dll and libstdc++-6.dll.

As suggested here adding -static-libgcc and -static-libstdc++ to the linker options might be wise, for the Windows version at least.

vuaru commented 11 years ago

Had some issues compiling your latest version. Played around making some edits, which refused to show up in the generated files.Turns out the make clean didn't clean up enough. The .rdmd folder in \tmp persisted, and the contents were reused without recompiling.

So I made some changes to the makefile (see last commits in my fork), but the fix_prefix is a bit of a mystery so I left it alone for now. (I'm not sure what the fix_prefix = ... is supposed to do, but for me it creates a \tmp folder in my root)

blm768 commented 11 years ago

The fix_prefix macro is used because of an issue with MinGW; it has Unix-style directory separators in its TEMP environment variable, which throws OPTLINK off. I just convert those to Windows-style separators.

Just out of curiosity, are you running make from the MinGW shell?

vuaru commented 11 years ago

Yes I do.

I assumed it was supposed to do something like that, but why I end up with a C:\tmp.rdmd.. is beyond me..

blm768 commented 11 years ago

The MinGW path is /tmp, which I convert to \tmp, which Windows treats as C:\tmp. I guess it would be a better idea to actually point it to the "real" system temp folder, wherever that is.

vuaru commented 11 years ago

tl;dr: The code in my fork compiles on Windows, and the small test-case in test.d works!.

I went back to the basics, commented/modified/separated the code to understand every part of the process. I started with the absolute minimum needed, then slowly added functionality. And eventually I ended up with a functional test.d.

Currently everything is explicitly managed via cppNew and cppDelete, no D constructors. I also don't have any subclass mixin yet.

I feel like this is a great step forward. If you can, please take a look at it :)

blm768 commented 10 years ago

Good work! I needed to clean up the code anyway; it was getting a bit hairy.

Life has gotten incredibly busy, so I probably won't have time to help with the project for a while. If you'd like, feel free to take leadership of the project for now.

On Thu, Nov 7, 2013 at 8:13 AM, vuaru notifications@github.com wrote:

tl;dr: The code in my fork compiles on Windows, and the small test-case in test.d works!.

I went back to the basics, commented/modified/separated the code to understand every part of the process. I started with the absolute minimum needed, then slowly added functionality. And eventually I ended up with a functional test.d.

Currently everything is explicitly managed via cppNew and cppDelete, no D constructors. I also don't have any subclass mixin yet.

I feel like this is a great step forward. If you can, please take a look at it :)

— Reply to this email directly or view it on GitHubhttps://github.com/blm768/BulletD/issues/1#issuecomment-27979455 .