Building Ogre .NET bindings Topic is solved
-
- Gnoblar
- Posts: 5
- Joined: Fri Aug 09, 2019 2:51 pm
- x 5
Building Ogre .NET bindings
Hello,
I found out Ogre has official .NET bindings now-a-days and would like to use it because I'm experienced with .NET but know only little about C++ and zero about cmake.
I found this bit of info: https://github.com/OGRECave/ogre/tree/m ... les/Csharp but I can't find that "build/csharp" folder that it talks about. I downloaded the master branch and looked for build, csharp, and *.cs, but except for a cmake file and the demo .cs file, I cant find anything.
I also searched through a prebuilt SDK download, but I didnt find any "ogre.dll", i did find a "libOgre.ddl" though.
Does anyone know how to build for .NET use, or know of some more info about this?
thanks
I found out Ogre has official .NET bindings now-a-days and would like to use it because I'm experienced with .NET but know only little about C++ and zero about cmake.
I found this bit of info: https://github.com/OGRECave/ogre/tree/m ... les/Csharp but I can't find that "build/csharp" folder that it talks about. I downloaded the master branch and looked for build, csharp, and *.cs, but except for a cmake file and the demo .cs file, I cant find anything.
I also searched through a prebuilt SDK download, but I didnt find any "ogre.dll", i did find a "libOgre.ddl" though.
Does anyone know how to build for .NET use, or know of some more info about this?
thanks
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Building Ogre .NET bindings
the contents of "build/csharp/" will be auto-generated if you build ogre with the CSharp component (requires SWIG). Here, "build" refers to the build folder.
The prebuild SDK currently does not include the .NET part as it was not yet tested on Windows. However I probably can change that for the devel builds..
The prebuild SDK currently does not include the .NET part as it was not yet tested on Windows. However I probably can change that for the devel builds..
-
- Gnoblar
- Posts: 5
- Joined: Fri Aug 09, 2019 2:51 pm
- x 5
Re: Building Ogre .NET bindings
Hi, i gotten a lot further now...
* I managed to get CMake generate with csharp support (i had to manually configure the SWIG exe (swigwin 4.0.0) in CMakeCache.txt) -> then it worked
* I built the c++ OGRE.sln -> csharp folder
* Building these cs files failed, so i made a .net project and used Visual Studio to see what was going on. I fixed two simple mistakes (an unneeded override and an enum that used uint values but was signed int) -> ogre.dll
But now, lastly, i'm lacking this libOgre.so you speak of. It didn't get generated anywhere, and when I run the built example.cs it complains Unable to load DLL 'libOgre_d', so that makes sense. But I don't know where to get it.
thanks
* I managed to get CMake generate with csharp support (i had to manually configure the SWIG exe (swigwin 4.0.0) in CMakeCache.txt) -> then it worked
* I built the c++ OGRE.sln -> csharp folder
* Building these cs files failed, so i made a .net project and used Visual Studio to see what was going on. I fixed two simple mistakes (an unneeded override and an enum that used uint values but was signed int) -> ogre.dll
But now, lastly, i'm lacking this libOgre.so you speak of. It didn't get generated anywhere, and when I run the built example.cs it complains Unable to load DLL 'libOgre_d', so that makes sense. But I don't know where to get it.
thanks
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Building Ogre .NET bindings
The csharp bindings consist of two parts. The ogre.dll you built and the libOgre.so native Part (probably Ogre_d.dll on Windows).
It should be located in build/lib or the csharp subfolder. Maybe you will have to rename it to libOgre_d.dll
It should be located in build/lib or the csharp subfolder. Maybe you will have to rename it to libOgre_d.dll
-
- Gnoblar
- Posts: 5
- Joined: Fri Aug 09, 2019 2:51 pm
- x 5
Re: Building Ogre .NET bindings
The libOgre project doesn't build, because OgreOverlay doesn;t build, because it didn't find ft2build.h.
So apparently is from the FreeType library (although the CMake log suggested FreeType was good to go). So, I downloaded freetype (https://github.com/ubawurinna/freetype-windows-binaries), added the include folder and now it gives me linker errors, eg.:
unresolved external symbol _FT_Init_FreeType referenced in function "public: virtual void __thiscall Ogre::Font::loadResource(class Ogre::Resource *)" (?loadResource@Font@Ogre@@UAEXPAVResource@2@@Z) OgreOverlay C:\ogre3d\build\Components\Overlay\OgreFont.obj 1
I can see the mising method names with a texteditor in the freetype.lib, so it's the right library. But when i add them to the library folders in the Visual Studio project, it keeps giving the same linker errors. So, either I include them incorrectly, or it doesnt like something about it...
So apparently is from the FreeType library (although the CMake log suggested FreeType was good to go). So, I downloaded freetype (https://github.com/ubawurinna/freetype-windows-binaries), added the include folder and now it gives me linker errors, eg.:
unresolved external symbol _FT_Init_FreeType referenced in function "public: virtual void __thiscall Ogre::Font::loadResource(class Ogre::Resource *)" (?loadResource@Font@Ogre@@UAEXPAVResource@2@@Z) OgreOverlay C:\ogre3d\build\Components\Overlay\OgreFont.obj 1
I can see the mising method names with a texteditor in the freetype.lib, so it's the right library. But when i add them to the library folders in the Visual Studio project, it keeps giving the same linker errors. So, either I include them incorrectly, or it doesnt like something about it...
-
- Gnoblar
- Posts: 16
- Joined: Mon Jun 03, 2019 2:45 pm
- x 19
Re: Building Ogre .NET bindings
meh, loading precompiled c++ binaries never works...( can be mismatched compiler version, compilation/linker flags etc )
its best to build all dependencies from source with the same compiler env/settings and on the same machine( just to be on the safe side )
that way if anything goes wrong at least you know whats the problem so you can fix it.
afaik ogre build scripts should download all dependencies and build them for you
otherwise https://bitbucket.org/cabalistic/ogredeps
its best to build all dependencies from source with the same compiler env/settings and on the same machine( just to be on the safe side )
that way if anything goes wrong at least you know whats the problem so you can fix it.
afaik ogre build scripts should download all dependencies and build them for you
otherwise https://bitbucket.org/cabalistic/ogredeps
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Building Ogre .NET bindings
Yeah, freetype should have been built in build/Dependencies. Maybe it did Not properly find the debug lib name
-
- Gnoblar
- Posts: 5
- Joined: Fri Aug 09, 2019 2:51 pm
- x 5
Re: Building Ogre .NET bindings
I think I'm almost there now... I can build almost all projects (dlls) of Ogre, and when I copy the build output to the example build output folder, the example starts but crashes when loading the scene. Indeed: dll Plugin_DotScene wont compile yet. (I just ignored it until now because I believed it unneeded for my usecase).
As a matter of fact, only 2 projects with errors remain:
I searched for these identifiers to try fixing the mismatches, but can't find their origin...
If you want me to repost this as a new question, let me know. This is just a "getting the 2 remaining Ogre dlls to build on Windows" problem.
As a matter of fact, only 2 projects with errors remain:
I searched for these identifiers to try fixing the mismatches, but can't find their origin...
If you want me to repost this as a new question, let me know. This is just a "getting the 2 remaining Ogre dlls to build on Windows" problem.
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Building Ogre .NET bindings
Something is wrong with your pugixml build. Either disable ogre_tools and dotscene Plugin in cmake or Go Back to the 1.12.1 tag
-
- Gnoblar
- Posts: 5
- Joined: Fri Aug 09, 2019 2:51 pm
- x 5
Re: Building Ogre .NET bindings
It works!
Wow, quite a journey Thanks for the help.
I made an extensive blog about the cleaned up process, for my future self and maybe others: https://hellholegames.wordpress.com/201 ... evelopers/
Thanks for all the help!!
Wow, quite a journey Thanks for the help.
I made an extensive blog about the cleaned up process, for my future self and maybe others: https://hellholegames.wordpress.com/201 ... evelopers/
Thanks for all the help!!
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Building Ogre .NET bindings
https://github.com/OGRECave/ogre/pull/1242demeter wrote: ↑Mon Aug 12, 2019 11:51 am I made an extensive blog about the cleaned up process, for my future self and maybe others: https://hellholegames.wordpress.com/201 ... evelopers/
just updated the devel build to include the C# sources as well. Everything .NET related is now in lib/cli/. Take a look at the latest SDK master snapshot whether this simplifies things for you.
- randomcode
- Halfling
- Posts: 53
- Joined: Wed Nov 11, 2015 11:31 am
- Location: People's Republic of China
- x 5
- Contact:
Re: Building Ogre .NET bindings
I have to say currently there are too many bugs in the Ogre .NET binding because they are incompatible with MOGRE (edit paroj)
OpenMB(Open Source Mount&Blade Series)
https://github.com/cookgreen/OpenMB
https://github.com/cookgreen/OpenMB
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Building Ogre .NET bindings
did you encounter anything else, besides what you reported here?
https://github.com/OGRECave/ogre/labels/SWIG
https://github.com/OGRECave/ogre/labels/SWIG
- randomcode
- Halfling
- Posts: 53
- Joined: Wed Nov 11, 2015 11:31 am
- Location: People's Republic of China
- x 5
- Contact:
Re: Building Ogre .NET bindings
I have to say ogre3d .net binding is not usable currently because they are incompatible with MOGRE (edit paroj)paroj wrote: ↑Tue Aug 11, 2020 10:54 am did you encounter anything else, besides what you reported here?
https://github.com/OGRECave/ogre/labels/SWIG
OpenMB(Open Source Mount&Blade Series)
https://github.com/cookgreen/OpenMB
https://github.com/cookgreen/OpenMB
-
- Gnoblar
- Posts: 9
- Joined: Fri Aug 20, 2021 2:00 pm
Re: Building Ogre .NET bindings
good work! it worked for me!demeter wrote: ↑Mon Aug 12, 2019 11:51 am It works!
Wow, quite a journey Thanks for the help.
I made an extensive blog about the cleaned up process, for my future self and maybe others: https://hellholegames.wordpress.com/201 ... evelopers/
Thanks for all the help!!
-
- Gnoblar
- Posts: 9
- Joined: Fri Aug 20, 2021 2:00 pm
Re: Building Ogre .NET bindings
Yeah, I'm trying to migrate a project in Mogre to Ogre 1.13.0.0 with swig, but it's not easy. I hope this work will facilitate future updates.randomcode wrote: ↑Tue Aug 18, 2020 1:49 pmI have to say ogre3d .net binding is not usable currently because they are incompatible with MOGRE (edit paroj)paroj wrote: ↑Tue Aug 11, 2020 10:54 am did you encounter anything else, besides what you reported here?
https://github.com/OGRECave/ogre/labels/SWIG