Compiling ODN step by step

alberts

22-11-2005 18:02:44

Hi

I finally could compile ODN this morning. I tell you what I have done to compile the sources, because I think the wiky explanation is not enough for the newbies:

First, I installed VS.NET 2003. You need to select c++ and c# to install. None of the c# subcomponents is needed, but you need to select all of the c++ subcomponents (the tools subcomponent is not actually needed). If you don’t select the c++ subcomponents you will get an error in the output window (not the task window) saying that the “casser” file could not be opened. This error doesn’t stop the compile process, so you have to review the entire text in the output window.

Then I download the prebuilt ogre sdk 1.0.4 version from http://prdownloads.sourceforge.net/ogre/OgreSDKSetup1.0.4_VC71.exe?download and install it.

To retrieve the content of the CVS I used TortoiseCVS, which can be downloaded from http://www.tortoisecvs.org/. After the installation I clicked with the right button over an explorer window and choose “CVS Checkout…” at the popup menu. At the TortoiseCVS window I entered these values:

Protocol: Password server (:pserver:)
Protocol parameters :
Server: cvs.sourceforge.net
Port:
Repository folder : /cvsroot/ogre
User name : anonymous
Module: ogreaddons/ogredotnet

When you push the OK button all the CVS contents are downloaded to a new directory.

I downloaded SWIG from http://prdownloads.sourceforge.net/swig/swigwin-1.3.27.zip and unzip it. Then I set the SWIG_HOME environment variable like is described in the wiki:

Right click on My Computer
Click Properties
Go to the Advanced tab
Click on Environment Variables button
Under User Variables click on New
Put SWIG_HOME as the name of the new environment variable
Under the variable VALUE, put the path to where SWIG.EXE is (without a trailing slash).
Example: “C:\Path\To\Swig”
NOT: “C:\Path\To\Swig\”

Then I opened the OgreDotNet solution in the ogredotnet directory and right clicked on Ceguibindings.i and selected Compile to generate the .cs files from the .i files. Did the same for the OgreBindings.i and OgreBindings_Cegui.i in that order. After that I closed and reopened the solution, so the missing file errors were out. There were two files that I had to exclude (delete) from the “ceguinet” project manually: SWIGTYPE_p_utf32.cs and SWIGTYPE_p_utf8.cs. There were three files that I had to add to the “OgreNet” project manually: SharedMaterialPtr.cs, SharedMeshPtr.cs and SharedSkeletonPtr.cs. I don’t know why these files are not in the project.

Finally, I built the entire solution and it produced seven .dll files and tons of warnings messages (but no errors).

To develop a C# Ogre application I create a new blank solution and copy all the .dll files generated by the ogredotnet solution into the \bin\debug directory of the new project. I copy into the same directory all of the files (*.dll, *.cfg,…) in $OGRE_SDK\bin\debug directory. Then, I add a reference in the project to the following .dll files: CeguiDotNet, Math3D, OgreDotNet and OgreDotNet.Cegui.

If you are working with the examples provided, you have to copy the $OGRE_SDK\media directory into the new project one too (the media directory should be at the same level of the bin directory). If you don’t do this properly your application will produce an error while trying to create the resource group bootstrap (see the msdos console).

I prefer to start a new application modifying the source code of the exampleApplication.cs file, instead of inheriting from the exampleApplication class (you have to rename the class, add a main method and remove the abstract keywords).

If you still cant compile the sources or you only need the ODN prebuilt binaries I've put it in http://www.ugr.es/~agsh/ogre/prebuilt_ogreDotNet_binaries-11-22-2005.rar. The version published by maleficus in this thread is not an up to date version (i think).

I hope this explanation helps to someone and I apologize for my english (my native language is spanish).

ryedin

28-11-2005 02:44:54

Before I found your post here, I had gotten as far as I could, but got stuck on the SharedMaterialPtr, SharedMeshPtr and SharedSkeletonPtr.cs files missing.

Did you just create empty files with those names or what? The MaterialPtr, MeshPtr and SkeletonPtr classes all derive from their respective "Shared" counterparts, so I'm just wondering what functionality am I going to be missing by either just creating blank classes or getting rid of that inheritance altogether...

EagleEye... we need you on this one :)

ryedin

28-11-2005 02:59:21

Ok, nevermind... for some reason those 3 files weren't visible to me but I just had to click "show all files" in the solution explorer, then right-click them and include them into the project.

alberts

01-12-2005 22:27:29

That is exactly what I wanted to say :lol:

In the new version this issue has been fixed. If someone need the newest prebuilt binaries they can be downloaded from http://www.ugr.es/~agsh/ogre/prebuilt_ogreDotNet_binaries-11-28-2005.rar.

sarge

06-12-2005 01:05:33

Great Post

The explanation in the Wiki leaves a bit out.

Thanks

GregH

02-02-2006 10:52:58

Hi AlbertS,

I can't thank you enough for the detailed steps you have given in this thread. Details like "there will be 7 files created" seem trivial...but it's really useful when you're trying to figure out if you've done the correct procedure!!!

BTW, Albert...apart from Gangsta related errors (whatever Gangsta is???) the removals and additions you mentioned appear to be resolved.

Thanks...let's hope this goes "Sticky". After all, if folks can't get the end product of our collaborative efforts (code, feedback, questions etc), it's all for nothing. Well done !!

Cheers,

G. Ps/ What is Gangsta anyway?

**Edit** Found this by EagleEye...



I've been talking with xavier from the main Ogre forum about the possibility of wrapping this "Gangsta Wrapper" (which is a thing that allows you to specify different physics packages as plugins). The reason this would be cool is because it would allow ANY of the current physics packages in use by Ogre users, to be used under OgreDotNet with a single project being wrapped. In effect, it's a physics package wrapper that would be wrapped... so it's a wrapped physics package wrapper, or a phsyics package wrapper wrapper.

EagleEye

02-02-2006 15:08:07

If the wiki leaves stuff out it's only becasue it's outdated and needs to be updated.

If you have an account on the main forum, you can use that same login/pw to edit the wiki pages.

Feel free guys, it's a community effort!

GregH

02-02-2006 21:17:56

Hi EagleEye,

So that's Wiki not Sticky !!! Hey AlbertS, as soon as my work settles down, would you like me to (attempt) to quote your compile procedure on the Wiki if you don't have the time?

Cheers,

G.

EagleEye

03-02-2006 04:30:35

Okay, honestly alberts' tutorial doesn't have to be put on the wiki page. Much of what he wrote was exactly what I had on there... the instructions on how to set up that SWIG_HOME environment variable is a direct copy/paste!

So, instead of creating a new wiki page, I'm updating the current one to be more clear, and updating it with current information.

EDITED TO ADD: Done with the edits.

GregH

03-02-2006 06:29:27

Hi EagleEye, AlbertS,

Thanks to your collaborative efforts, I've been able to use WinCVS to download all of the OgreDotNet addons, compile them, and with a few hours of shifting resource folders, I've managed to get all but one demo running (DemoCeguiMenus falls over on Tahoma-12 font, even though it's with Impact font in the same folder?)

I'm using OGRE SDK 1.06, and given that I compiled it using the latest CVS download, I'm impressed that the demos ran...so compatibility doesn't appear to be an issue.

Also thank you EagleEye for updating the Wiki so folks can benefit from all the hard work you guys have put in !!!

Cheers,

G.

alberts

03-02-2006 10:53:02

Much of what he wrote was exactly what I had on there... the instructions on how to set up that SWIG_HOME environment variable is a direct copy/paste!

Ok, the instructions on settitng up SWIG is a copy/paste (that's why I wrote "Then I set the SWIG_HOME environment variable like is described in the wiki"). For me is an effort to write in english, so I didn't want to reinvent the wheel. :oops:

I only wanted to fill some gaps in the wiki, but I think I don't speak english so well to edit an "official" document, so I decided to write what I have done to compile ODN following the (your) wiki explanation and some post in the forum. That's why my explanation is similar (I think it's not exactly) to the wiki one.

I hoped that someone who speak english better update the wiki. Thanks EagleEye and GregH for that :)

GregH

03-02-2006 13:46:27

Hi AlbertS, EagleEye,

Good intentions, good outcomes, fixed Wiki, fresh working binaries - and from all points of the world. Well if that isn't one small step for man-kind, I don't know what is ! :D

Just imagine what we can achieve in another year from now...

I wish we could all have a beer together...or perhaps EagleEye's drink of choice...Sam's Choice ? 8)

Cheers,

G.

EagleEye

03-02-2006 15:01:08

Just so we're all clear on this... I wasn't mad or anything... I didn't feel plagiarized. :)

sarge

08-02-2006 13:22:32

Just so we're all clear on this... I wasn't mad or anything... I didn't feel plagiarized. :)

I also hope you were not offended by my post. I didn't mean it as a slight on the wiki. A tremendous amount of (unpaid for) work went on and I certainly appreciate it.

EagleEye

08-02-2006 20:59:54

Just so we're all clear on this... I wasn't mad or anything... I didn't feel plagiarized. :)

I also hope you were not offended by my post. I didn't mean it as a slight on the wiki. A tremendous amount of (unpaid for) work went on and I certainly appreciate it.


Oh no, no offense taken at all. There was some updating that needed to be done, and I just hadn't gotten to it yet... it's done now, so hopefully no complaints. :)

lopemanc

14-02-2006 00:17:38

Hi All,

New here and fairly new to C# and .net. Played with VB.Net a while back and read a fair amount on C# but not real use. SO basically I am a newbie.

Any way I tried to follow this post and also the page on the WIKI. I get to the spot below and start to run into problems. I have VS 2005 C++ Express and C# Express installed. I am unclear on which I should open and how I should pull the project in. I have tried a couple of different ways with varying levels of success. I think maybe I am running into an issue because the project and instruction are created for an earlier version of VS. Instead of detailing out what I did with each IDE maybe somebody could just list out how to do it with VS 2005 Express.

Then I opened the OgreDotNet solution in the ogredotnet directory and right clicked on Ceguibindings.i and selected Compile to generate the .cs files from the .i files. Did the same for the OgreBindings.i and OgreBindings_Cegui.i in that order. After that I closed and reopened the solution, so the missing file errors were out. There were two files that I had to exclude (delete) from the “ceguinet” project manually: SWIGTYPE_p_utf32.cs and SWIGTYPE_p_utf8.cs. There were three files that I had to add to the “OgreNet” project manually: SharedMaterialPtr.cs, SharedMeshPtr.cs and SharedSkeletonPtr.cs. I don’t know why these files are not in the project.