Typical dev environment under windows

Typical dev environment under windows

Postby hwoarangmy » 16 Apr 2014, 19:32

Hello,

I am a coder and I am interested in your project. I have no experience with Ogre but it is the occasion to see the beast :)
Can someone tell me what's the most used IDE and stuff to develop OD ?
I am currently using Code::Blocks but it seems like there is no Ogre SDK 1.9 easy to download. And first of all, I would like to get a running environment to have a look into the OD code.

Thanks
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby Danimal » 16 Apr 2014, 20:30

Welcome to this forum Hwoarangmy, the code guys will talk to you soon.
User avatar
Danimal
OD Moderator
 
Posts: 1407
Joined: 23 Nov 2010, 13:50

Re: Typical dev environment under windows

Postby Bertram » 17 Apr 2014, 10:28

Hi hwoarangmy, :)

As Danimal said, here am I. ;)

With Elvano, we're both slowing but surely putting the documentation up to date, and I really need to set up a how to compile on windows forum thread until he's finished with the backup system.

That said, for what is actually interesting you, the typical working environment on windows is currently involving you to work with MSVC 2012 (compiler version 11).
Older MSVC versions won't work, since the necessary C++1x features weren't implemented, IIRC

In a nutshell, what you need to do is:
- Install MSVC 2012 Express (And I guess, make a Windows live account to register your copy, sorry for that, but it's needed.)

- Install CMake + CMake-gui: http://www.cmake.org/cmake/resources/software.html

- Download The Ogre 1.9.x source along with the MSVC 2012 deps:
http://www.ogre3d.org/download/source
http://www.ogre3d.org/download/sdk

- Download the DirectX SDK (useless for us, but prevents compilation errors when configuring/building CEGUI): http://www.microsoft.com/en-us/download ... px?id=6812
(Important, download Ogre and DirectX along with CEGUI SDKs before starting compiling)

- Download the latest CEGUI 0.8.x source + the dependencies build: http://cegui.org.uk/download

- Check the boost lib version used by Ogre (in the source package) and download the same boost source version because we need more boost libs than provided by ogre
AND we need to have the same boost version used by Ogre to be able to link the final binary.
http://www.boost.org/

First, Compilation notes:
- I will assume you're at ease with configuring a project file with cmake. If not, you should look at a few tutorials, and fiddle a bit, it's not hard.
Once you're ok with it, configuring a project, like for CEGUI, means open CMake-gui, indicate it the source folder and the build folder, click on configure, fix the variables not set and then on the Create button. You'll then be asked for the kind of project file to use, select MSVC 11 (which is the compiler version of VC++ 2012).
Then go and open the newly created sln project file with the MSVC IDE, select generate solution, and pray.

- Compile the dependencies, and then CEGUI itself. There is an interesting video showing you how to do that: http://www.youtube.com/watch?v=nWm5aec8xkE
(Don't forget to make sure the CEGUI Ogre renderer compilation option is on.)
- Once CEGUI is compiled, there are two header files that can be copied from the build folder back to the include folder, to ease the pain. I'll add details when I'll have them.

- Compile boost using the MSVC compiler. Note that boost is using the Jam build system. I can't remember just right now (I'll edit my comment when I've checked) but you'll have to copy the gcc build script and change the build option to use MSVC11 (which is the compiler version of the VC++ 2012)

- Compile Ogre.

Once all that is done, you can pat yourself on the back. :)

You can download OD source, and configure them using cmake to build MSVC11 project file.

There are three things that still need to be done manually before building atm, and unfortunately each time the OD CMake file is changed:

Right click on the 'OpenDungeons' solution on the right and select properties.
- In the C/C++ horizontal tab, you have an option called IIRC toolset: Select the XP one, or your binary won't start on XP.
- In the Link Editor tab, the option 'Force file output' is empty, select the FORCE:Multiple option.
You have to do so because of the boost lib used, defining two times the same set of functions, once for Ogre, once for OD. It is harmless in our case to select this option.
- In the same tab, there is an option called 'libraries folders', you'll have to add there the folder where the 'libCEGUIOgreRenderer.lib' file is,
or it won't link.

Then, you can generate the solution.

I've done all that from memory, so please takes this all with a bit of salt.

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby hwoarangmy » 17 Apr 2014, 20:36

Thanks for your quick and complete answer. To answer your question, I have not had the opportunity to use CMake so far but I am used to linux Makefiles so I hope I should understand how it works. Concernning MVS2012, I already have it so no problem ;)
I will download all this stuff and have a look soon.
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby hwoarangmy » 30 Apr 2014, 21:50

I have succeded to compile and run the game. During the process, I have seen some problems :
- Whith CMake, SFML libraries are asked in release and debug. But within VS2012, for both, the release version is used.
- OpenAL is needed (in the wiki, it is written that is is needed only for linux but in fact, it is also for windows)
- CEGUI needs freetype support (flag CEGUI_HAS_FREETYPE is needed in CMake before compiling CEGUI).
- In OD sources, there is a problem within the file Server.cpp. With the current include order, sleep.h is included and does :
{l Code}: {l Select All Code}
#  define sleep(t)  Sleep((t) * 1000)

After that, through "Creature.h", "sfml/system/sleep.hpp" is included and contains :
{l Code}: {l Select All Code}
void SFML_SYSTEM_API sleep(Time duration);


So there is a compilation error. I have fixed that by changing include order ("Creature.h" before "sleep.h"). Perhaps it would be better to define something like "OD_sleep" instead of using sleep but I have not seen how much changes it would require.

Concerning the game, in release mode, it works normally but in debug, it lags so much it is not playable. Am I doing something wrong ?

If needed, I can write a complete step by step tutorial on how to build the game with windows.
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby Bertram » 30 Apr 2014, 22:08

Hi :)

- OpenAL is needed (in the wiki, it is written that is is needed only for linux but in fact, it is also for windows)
- CEGUI needs freetype support (flag CEGUI_HAS_FREETYPE is needed in CMake before compiling CEGUI).

True, sorry, for the salt ;), I'll fix that asap in the wiki.

If needed, I can write a complete step by step tutorial on how to build the game with windows.

Your knowledge is much fresher than mine so by any means, please do. :)
You can write that down here and I put that in the wiki, or maybe Elvano will agree to give you wiki acess to avoid duplicate the job?

As for the sleep problem, yes, we have to fix this properly so, again, if you feel ready for it, don't hesitate a second. :)

Concerning the game, in release mode, it works normally but in debug, it lags so much it is not playable. Am I doing something wrong ?

I don't think you are.

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby hwoarangmy » 30 Apr 2014, 23:18

Bertram {l Wrote}:True, sorry, for the salt ;), I'll fix that asap in the wiki.
No problem, it's just if someone finds this thread, he will know. But anyway, CMake is clear about the error.

Bertram {l Wrote}:You can write that down here and I put that in the wiki, or maybe Elvano will agree to give you wiki acess to avoid duplicate the job?
I have already written what I did (as a remainder). Just tell me where you want me to put it :)

Bertram {l Wrote}:As for the sleep problem, yes, we have to fix this properly so, again, if you feel ready for it, don't hesitate a second. :)
I will have a look. I just hope that I wont break the linux version :) Should not be the hardest task :)

Bertram {l Wrote}:I don't think you are.
Is it the same with the linux version ? Because like this, it's just not usable for debug...
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby Bertram » 30 Apr 2014, 23:51

Hi :)

Is it the same with the linux version ? Because like this, it's just not usable for debug...

Yes, it's the same thing at least for me on linux. I bore with it when desperately in need of debug, but otherwise, it would be cool to determine the bottle necks.

I have already written what I did (as a remainder). Just tell me where you want me to put it :)

Feel free to ask Elvano about wiki access. Would he disagree for any reason, you could always put it here and I'll do the translation there myself.

I will have a look. I just hope that I wont break the linux version :) Should not be the hardest task :)

I can test this point for you. Thanks! :)

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby hwoarangmy » 01 May 2014, 22:53

I have almost finished the how to build OD with MVS2012 but I have seen some problems with the cmake files. I'm gonna try to have a look so that compiling OD is as simple as possible :)
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby Bertram » 02 May 2014, 00:09

Cool to hear! :)
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby hwoarangmy » 03 May 2014, 22:54

I have finished what I wanted to do.
So far, what I have done :
- Fixed bug with sleep (in fact, sleep.h was only included 2 times so it was not a big job :) )
- Change in Makefiles : sfml audio and system libs release version were included in release for both configurations even if release and debug libs were found (that caused a crash at runtime for me).
- Change in Makefiles : CEGUI libs were asked only once (not in debug and release version). Now, they are asked for both configurations. If only one is found, it is used for both.
- Change in Makefiles : CEGUI include dir was not searched if nested in "include/cegui-0". Don't know why but for me, it is created there when I compile CEGUI so I added this search path.
- Change in Makefiles : The force output option is now set by cmake. I have done that only for MSVS since I am not sure it works for the other configurations.

Things I have seen while surfing :
- Several links are dead in : https://github.com/Bertram25/OpenDungeons
- I think it is not very clear where OD sources are. From what I have understood, the official repository is for sources : http://sourceforge.net/p/opendungeons/g ... ster/tree/ and for media : http://sourceforge.net/p/opendungeons/svn/HEAD/tree/. If the official repository is the one I said, it is strange because some files are referenced in the Makefile but not present in the sources : (DummyArrayClass.cpp, SlopeWalk.cpp, Vector3i.cpp).

Concerning the changes I made, I have read in the wiki that another developper has to check if it seems ok. But it is not very clear what I should do to start (send a mail to someone ? Commit the changes I made somewhere ?). I am not used to git/svn so if I have something to do there, please detail a little bit what.

Concerning the compilation howto, I have finished. I just need to download the latest version of sources to check if I can compile after integration (but as I said before, I could not compile them so I will try as soon as someone confirms what's the working repository). I have had no word from elvano concerning access to wiki so far so I will post it in this thread.

Regards,
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby Bertram » 05 May 2014, 21:26

Hi :)

- Fixed bug with sleep (in fact, sleep.h was only included 2 times so it was not a big job :) )
- Change in Makefiles : sfml audio and system libs release version were included in release for both configurations even if release and debug libs were found (that caused a crash at runtime for me).
- Change in Makefiles : CEGUI libs were asked only once (not in debug and release version). Now, they are asked for both configurations. If only one is found, it is used for both.
- Change in Makefiles : CEGUI include dir was not searched if nested in "include/cegui-0". Don't know why but for me, it is created there when I compile CEGUI so I added this search path.
- Change in Makefiles : The force output option is now set by cmake. I have done that only for MSVS since I am not sure it works for the other configurations.
[...]
Concerning the changes I made, I have read in the wiki that another developper has to check if it seems ok. But it is not very clear what I should do to start (send a mail to someone ? Commit the changes I made somewhere ?). I am not used to git/svn so if I have something to do there, please detail a little bit what.

Thanks for all the work done on this!! :) The changes described sound clever, and I'd be happy to review them and include them. Yet, I can' t manage git/svn access for you, you'll have to ask Elvano once more.
In the meanwhile, we could do either of the two things:
1. You could make a githug account and fork my repo. then push your changes there. We'll be able to talk there more efficently about the review.
2. You could use the 'git format-patch' statement and create formatted patch files for us to review here.

Concerning the compilation howto, I have finished. I just need to download the latest version of sources to check if I can compile after integration (but as I said before, I could not compile them so I will try as soon as someone confirms what's the working repository). I have had no word from elvano concerning access to wiki so far so I will post it in this thread.

Elvano, please!!!! It's your call. (I'll mail him)

- Several links are dead in : https://github.com/Bertram25/OpenDungeons

Oh. Which ones? (My repo isn't meant to be the reference so it might happen, but feel free to point out.) :)

- I think it is not very clear where OD sources are. From what I have understood, the official repository is for sources : http://sourceforge.net/p/opendungeons/g ... ster/tree/ and for media : http://sourceforge.net/p/opendungeons/svn/HEAD/tree/. If the official repository is the one I said, it is strange because some files are referenced in the Makefile but not present in the sources : (DummyArrayClass.cpp, SlopeWalk.cpp, Vector3i.cpp).

The official repo is indeed the sourceforge one. Yet, you're right, files are missing due to a broken commit from Paul. He since fixed it:
http://sourceforge.net/p/opendungeons/g ... 428f067be/

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby hwoarangmy » 05 May 2014, 23:26

Bertram {l Wrote}:1. You could make a githug account and fork my repo. then push your changes there. We'll be able to talk there more efficently about the review.
2. You could use the 'git format-patch' statement and create formatted patch files for us to review here.
I have forked your repository. I will come back to you as soon as I have uploaded the changes.

Bertram {l Wrote}:Oh. Which ones? (My repo isn't meant to be the reference so it might happen, but feel free to point out.) :)
I didn't know if it was the official repository or not :)
But the links are :
http://opendungeons.sourceforge.net/ind ... Guidelines
http://opendungeons.sourceforge.net/index.php/Download

Regards,
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby Bertram » 06 May 2014, 09:55

Hi :)

Cool. I'm looking forward to your changes.

I've also fixed the dead links.

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby hwoarangmy » 07 May 2014, 07:11

Hi,

I have commited the changes in my branch. You can have a look :)
https://github.com/hwoarangmy/OpenDungeons

By the way, I am currently trying to compile OD with MinGW. So far, I have compiled everything (including OD) with a few changes but I cannot launch the game (it crashes). If I manage to make it work, I will also write an howto :)

Regards,
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby Bertram » 07 May 2014, 07:59

Cool! I've commented there. It's some nice work just by the look of it already, thanks!
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby hwoarangmy » 08 May 2014, 00:36

I have managed to compile and run OD with MinGW :)

I've taken notes because I had to make changes with CEGUI and to play again with CMake. The howto is on its way :)

BTW, could be nice to choose where the sources shoud come from in the howtos. From your repository or from the official ones ?
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby Bertram » 08 May 2014, 08:03

Hi,

I have managed to compile and run OD with MinGW :)
I've taken notes because I had to make changes with CEGUI and to play again with CMake. The howto is on its way :)


Wow, great! I must say you succeeded when I fail and gave up miserably, so all my kudos for that! :D

BTW, could be nice to choose where the sources shoud come from in the howtos. From your repository or from the official ones ?

I'll be honest, even if I like github a lot for code review and collaboration in general, the official sources are on sourceforge and should be used for the how-tos.
I wouldn't mind if we keep reviewing each other's code on github before pushing to source forge, though. But it's just my two cents. ;)

Congrats for the work done and best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby hwoarangmy » 10 May 2014, 01:27

The changes are done in my branch. You can test if you want. I will need to make some more to compile with MinGW because the CXX flag is also needed. I will try to set it in the Makefile so that it is not required anymore to set it by hand.

To test with Linux, I have done everything to have the closest environment to the one most users will have. I installed through apt-get every needed libraries except CEGUI (because I couldn't find the 0.8.3). So, I can also post the Linux howto step by step :)
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby Bertram » 10 May 2014, 08:15

Hi :)

Thanks. This is cool news, I will test shortly. Why did you close your pull request btw?
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby Bertram » 10 May 2014, 09:38

Hi again,

If you ever fall on this error:
{l Code}: {l Select All Code}
Loading library RenderSystem_GL
An internal Ogre3D error ocurred: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library RenderSystem_GL.  System Error: RenderSystem_GL.so.1.9.0: cannot open shared object file: No such file or directory in DynLib::load at /tmp/buildd/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreDynLib.cpp (line 109)

You'll have to edit the plugins.cfg and/or plugins_d.cfg files copied by CMake when imvoked and change the "PluginFolder=" line to where the GL Render system shared lib is located.

It's working for me with the given value:
{l Code}: {l Select All Code}
PluginFolder=/usr/lib/x86_64-linux-gnu/OGRE-1.9.0/


Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby Bertram » 10 May 2014, 09:51

Ah, I merged your patches in my own repo, btw.
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby hwoarangmy » 10 May 2014, 11:56

I closed the pull request because of a miss clic :(
I didn't know what it meant so I didn't pay attention. But if you ask, i guess it was a mistake... Should I open another one ?

I had the plugin error (even on windows) but I had already set the correct plugin folder. At this time, when I try to launch OD, I get a segfault after choosing the Ogre renderer. But it might be related to the fact that I am using VirtualBox...
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Typical dev environment under windows

Postby Bertram » 10 May 2014, 20:38

Hi :)

I closed the pull request because of a miss clic :(
I didn't know what it meant so I didn't pay attention. But if you ask, i guess it was a mistake... Should I open another one ?


Np. It can happen. You don't have to open another one since I cherry-picked your commits. You may have noticed, but I asked Paul to try your commits as well (here on the forums) to make sure it doesn't break his build either,
and I'll merge your commits in the development branch once he's tried

I had the plugin error (even on windows) but I had already set the correct plugin folder. At this time, when I try to launch OD, I get a segfault after choosing the Ogre renderer. But it might be related to the fact that I am using VirtualBox...

Yeah, might be. Is it something like this?
http://answers.ros.org/question/10056/r ... lxcontext/

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Typical dev environment under windows

Postby paul424 » 10 May 2014, 21:11

Just don't care about me , my ISP failed again ... the github.com is of course unreachable from here .... :(
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Who is online

Users browsing this forum: No registered users and 1 guest