[Ogre on Linux] problem of compilation

Get answers to all your basic programming questions. No Ogre questions, please!
Post Reply
informatirien
Gnoblar
Posts: 12
Joined: Thu Apr 26, 2012 7:17 pm

[Ogre on Linux] problem of compilation

Post by informatirien »

Hello,

I am a newbie with Ogre 3d I have tried to compile a sample code that it hasn't worked because the instruction #include "windows.h"

I need to know if there's a method to replace this instruction?

I'll be very grateful if you have a code that works on Linux.

Thank's.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [Ogre on Linux] problem of compilation

Post by jacmoe »

Then don't use that sample then?

I am not aware of any official Ogre samples which uses that kind of code..

Which sample and from where?
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
informatirien
Gnoblar
Posts: 12
Joined: Thu Apr 26, 2012 7:17 pm

Re: [Ogre on Linux] problem of compilation

Post by informatirien »

This is the link from where i get the sample code


http://www.ogre3d.org/tikiwiki/Ogre+Wik ... +Framework
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [Ogre on Linux] problem of compilation

Post by jacmoe »

Yes, and where exactly is that #include "windows.h" line? :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
informatirien
Gnoblar
Posts: 12
Joined: Thu Apr 26, 2012 7:17 pm

Re: [Ogre on Linux] problem of compilation

Post by informatirien »

yes in TutorialApplication.cpp
there is

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
User avatar
areay
Bugbear
Posts: 819
Joined: Wed May 05, 2010 4:59 am
Location: Auckland, NZ
x 69

Re: [Ogre on Linux] problem of compilation

Post by areay »

That file will only be included if you're compiling on Windows. If you are running under Linux it'll never be included by the preprocessor.

How about you show us the error that your compiler is throwing?

Otherwise you can just delete that include as you're definitely not running on Windows right?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [Ogre on Linux] problem of compilation

Post by jacmoe »

informatirien wrote:yes in TutorialApplication.cpp
there is

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
Yeah, I forgot about that.
It's called 'conditional compilation', and it won't present a problem for you because OGRE_PLATFORM will not be OGRE_PLATFORM_WIN32, right? :)

Instead of assuming things, let's get some facts on the table.

Areay is right. ;)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
areay
Bugbear
Posts: 819
Joined: Wed May 05, 2010 4:59 am
Location: Auckland, NZ
x 69

Re: [Ogre on Linux] problem of compilation

Post by areay »

jacmoe wrote:Areay is right. ;)
Woot, first time for everything right? That's now my forum signature
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: [Ogre on Linux] problem of compilation

Post by spacegaier »

areay wrote:
jacmoe wrote:Areay is right. ;)
Woot, first time for everything right? That's now my forum signature
[OT] +1 :D [/OT]
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
informatirien
Gnoblar
Posts: 12
Joined: Thu Apr 26, 2012 7:17 pm

Re: [Ogre on Linux] problem of compilation

Post by informatirien »

Thank's ;
I compile the code but I have an other problem
when I run I get this line
InternalErrorException): Could not load dynamic library /usr/lib64/OGRE/RenderSystem_GL. System Error: /usr/lib64/OGRE/RenderSystem_GL.so: cannot open shared object file: No such file or directory in DynLib::load at /home/abuild/rpmbuild/BUILD/ogre_src_v1-7-4/OgreMain/src/OgreDynLib.cpp (line 91)
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 135
Contact:

Re: [Ogre on Linux] problem of compilation

Post by spacegaier »

Sounds like the OpenGL Render System DLL is not where it is supposed to. In most cases it needs to be next to your EXE, but you can change that in the plugins.cfg file.

BTW: That at least how it works on Win, but I am not a Linux guy ;) .
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
User avatar
Miscreant
Greenskin
Posts: 126
Joined: Mon Jun 14, 2010 2:12 am
Location: Brisbane, Australia
x 3

Re: [Ogre on Linux] problem of compilation

Post by Miscreant »

Check your plugins.cfg file (should be in the same directory as the application you compiled). It should say something like this: (with whichever plugins you're not using commented out with the "#")

Code: Select all

# Defines plugins to load

# Define plugin folder
PluginFolder=/usr/lib64/OGRE/

# Define plugins
# Plugin=RenderSystem_Direct3D9
# Plugin=RenderSystem_Direct3D10
# Plugin=RenderSystem_Direct3D11
 Plugin=RenderSystem_GL
# Plugin=RenderSystem_GLES
# Plugin=Plugin_ParticleFX
# Plugin=Plugin_BSPSceneManager
# Plugin=Plugin_CgProgramManager
# Plugin=Plugin_PCZSceneManager
# Plugin=Plugin_OctreeZone
# Plugin=Plugin_OctreeSceneManager
See if you can find RenderSystem_GL.so and change PluginFolder to wherever RenderSystem_GL.so (and your other plugins) are stored
Post Reply