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.
[Ogre on Linux] problem of compilation
-
- Gnoblar
- Posts: 12
- Joined: Thu Apr 26, 2012 7:17 pm
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: [Ogre on Linux] problem of compilation
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?
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.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Gnoblar
- Posts: 12
- Joined: Thu Apr 26, 2012 7:17 pm
Re: [Ogre on Linux] problem of compilation
This is the link from where i get the sample code
http://www.ogre3d.org/tikiwiki/Ogre+Wik ... +Framework
http://www.ogre3d.org/tikiwiki/Ogre+Wik ... +Framework
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: [Ogre on Linux] problem of compilation
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.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Gnoblar
- Posts: 12
- Joined: Thu Apr 26, 2012 7:17 pm
Re: [Ogre on Linux] problem of compilation
yes in TutorialApplication.cpp
there is
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
there is
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
-
- Bugbear
- Posts: 819
- Joined: Wed May 05, 2010 4:59 am
- Location: Auckland, NZ
- x 69
Re: [Ogre on Linux] problem of compilation
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?
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?
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: [Ogre on Linux] problem of compilation
Yeah, I forgot about that.informatirien wrote:yes in TutorialApplication.cpp
there is
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
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.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Bugbear
- Posts: 819
- Joined: Wed May 05, 2010 4:59 am
- Location: Auckland, NZ
- x 69
Re: [Ogre on Linux] problem of compilation
Woot, first time for everything right? That's now my forum signaturejacmoe wrote:Areay is right.
-
- OGRE Team Member
- Posts: 4304
- Joined: Mon Feb 04, 2008 2:02 pm
- Location: Germany
- x 136
Re: [Ogre on Linux] problem of compilation
[OT] +1areay wrote:Woot, first time for everything right? That's now my forum signaturejacmoe wrote:Areay is right.

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...
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
-
- Gnoblar
- Posts: 12
- Joined: Thu Apr 26, 2012 7:17 pm
Re: [Ogre on Linux] problem of compilation
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)
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)
-
- OGRE Team Member
- Posts: 4304
- Joined: Mon Feb 04, 2008 2:02 pm
- Location: Germany
- x 136
Re: [Ogre on Linux] problem of compilation
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
.
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...
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
-
- Greenskin
- Posts: 126
- Joined: Mon Jun 14, 2010 2:12 am
- Location: Brisbane, Australia
- x 3
Re: [Ogre on Linux] problem of compilation
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 "#")
See if you can find RenderSystem_GL.so and change PluginFolder to wherever RenderSystem_GL.so (and your other plugins) are stored
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