Hey guys,
Has anyone managed to get Box2D working in C# using SWIG? I can't seem to get it to work. I'm cross-posting this from SO.
---
I'm trying to compile Box2D for use in C# with SWIG.
I've created this Box2D.i file,
Which I placed one level up from the Box2D.h file file, and "compiled" it with,
This gives me all the .cs wrapper classes and Box2D_wrap.cxx. Problem is, I'm not quite sure what to do next.
I've tried adding that cxx file back into the C++ project and recompiling with /cli enabled, but when I try using the library in a C# app I just get errors. I've tried creating a fresh CLI library and adding the cxx file and linking both the unmanaged Box2D.dll and .lib, which I think I got the compile once... but that didn't work either.
1. What am I doing wrong?
2. How can I get it to work?
Using CMake, Windows 7, Visual Studio 2010, latest Box2D from SVN.
Has anyone managed to get Box2D working in C# using SWIG? I can't seem to get it to work. I'm cross-posting this from SO.
---
I'm trying to compile Box2D for use in C# with SWIG.
I've created this Box2D.i file,
Code: Select all
%module Box2D
%{
#include "Box2D/Box2D.h"
%}
%include "Box2D/Box2D.h" Which I placed one level up from the Box2D.h file file, and "compiled" it with,
Code: Select all
swig.exe -csharp -c++ -includeall -ignoremissing -outdir SWIG Box2d.iThis gives me all the .cs wrapper classes and Box2D_wrap.cxx. Problem is, I'm not quite sure what to do next.
I've tried adding that cxx file back into the C++ project and recompiling with /cli enabled, but when I try using the library in a C# app I just get errors. I've tried creating a fresh CLI library and adding the cxx file and linking both the unmanaged Box2D.dll and .lib, which I think I got the compile once... but that didn't work either.
1. What am I doing wrong?
2. How can I get it to work?
Using CMake, Windows 7, Visual Studio 2010, latest Box2D from SVN.