[SOLVED]Can't build Ogre3D 1.9 project with CMake on Linux.

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
50cent2513
Gnoblar
Posts: 3
Joined: Thu Aug 07, 2014 1:00 pm

[SOLVED]Can't build Ogre3D 1.9 project with CMake on Linux.

Post by 50cent2513 »

Hello! I am an absolute beginner in Ogre 3D. I managed to get it running on Windows, but I am experiencing some problems with Linux(I am using Debian 7.6 Wheezy). I was following this wiki article and got stuck at running the make command. The console shows me these errors:

Code: Select all

In file included from /home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:17:0:
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.h:37:85: error: expected class-name before ‘,’ token
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp: In constructor ‘BaseApplication::BaseApplication()’:
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:25:19: error: ‘BLANK’ is not a member of ‘Ogre::StringUtil’
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:26:17: error: ‘BLANK’ is not a member of ‘Ogre::StringUtil’
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp: In destructor ‘virtual BaseApplication::~BaseApplication()’:
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:45:11: error: ‘Ogre::WindowEventUtilities’ has not been declared
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp: In member function ‘virtual void BaseApplication::createFrameListener()’:
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:115:11: error: ‘Ogre::WindowEventUtilities’ has not been declared
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp: In member function ‘virtual bool BaseApplication::setup()’:
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:230:5: error: incomplete type ‘Ogre::TextureManager’ used in nested name specifier
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp: In member function ‘virtual bool BaseApplication::keyPressed(const OIS::KeyEvent&)’:
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:327:9: error: incomplete type ‘Ogre::MaterialManager’ used in nested name specifier
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:328:9: error: incomplete type ‘Ogre::MaterialManager’ used in nested name specifier
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:356:9: error: incomplete type ‘Ogre::TextureManager’ used in nested name specifier
make[2]: *** [CMakeFiles/OgreApp.dir/BaseApplication.cpp.o] Error 1
make[1]: *** [CMakeFiles/OgreApp.dir/all] Error 2
make: *** [all] Error 2
I also noticed that CMake gives me a warning when configuring the project:

Code: Select all

CMake Warning (dev) in CMakeLists.txt:
  A logical block opening on the line

    /home/mushmula/Плот/clean_ogre_cmake_project/CMakeLists.txt:29 (if)

  closes on the line

    /home/mushmula/Плот/clean_ogre_cmake_project/CMakeLists.txt:41 (endif)

  with mis-matching arguments.
This warning is for project developers.  Use -Wno-dev to suppress it.
I have no idea why is this happening :( . I have built and installed Ogre3D 1.9 from the source code. I have installed all of the dependencies. Everything went well without any errors except this. If someone wishes to help me, I will be extremely greatful!
Last edited by 50cent2513 on Thu Aug 07, 2014 8:09 pm, edited 1 time in total.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Can not build Ogre3D 1.9 project with CMake on Linux.

Post by c6burns »

You can ignore that CMake warning, it's not actually a problem. You should be able to just add these includes under the existing includes in BaseApplication.cpp:

Code: Select all

#include <OgreMaterialManager.h>
#include <OgreTextureManager.h>
#include <OgreWindowEventUtilities.h>
error: ‘BLANK’ is not a member of ‘Ogre::StringUtil’ is happening because you are using default branch which is version 1.10. That's totally fine to do, you just need to replace Ogre::StringUtil::BLANK with Ogre::BLANKSTRING
User avatar
50cent2513
Gnoblar
Posts: 3
Joined: Thu Aug 07, 2014 1:00 pm

Re: Can not build Ogre3D 1.9 project with CMake on Linux.

Post by 50cent2513 »

c6burns wrote:You can ignore that CMake warning, it's not actually a problem. You should be able to just add these includes under the existing includes in BaseApplication.cpp:

Code: Select all

#include <OgreMaterialManager.h>
#include <OgreTextureManager.h>
#include <OgreWindowEventUtilities.h>
error: ‘BLANK’ is not a member of ‘Ogre::StringUtil’ is happening because you are using default branch which is version 1.10. That's totally fine to do, you just need to replace Ogre::StringUtil::BLANK with Ogre::BLANKSTRING
I followed your instructions and now when I run the make command, I get this:

Code: Select all

In file included from /home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:17:0:
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.h:37:85: error: expected class-name before ‘,’ token
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp: In destructor ‘virtual BaseApplication::~BaseApplication()’:
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:48:72: error: no matching function for call to ‘Ogre::WindowEventUtilities::removeWindowEventListener(Ogre::RenderWindow*&, BaseApplication* const)’
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:48:72: note: candidate is:
In file included from /home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:20:0:
/usr/local/include/OGRE/OgreWindowEventUtilities.h:152:21: note: static void Ogre::WindowEventUtilities::removeWindowEventListener(Ogre::RenderWindow*, Ogre::WindowEventListener*)
/usr/local/include/OGRE/OgreWindowEventUtilities.h:152:21: note:   no known conversion for argument 2 from ‘BaseApplication* const’ to ‘Ogre::WindowEventListener*’
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp: In member function ‘virtual void BaseApplication::createFrameListener()’:
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:118:69: error: no matching function for call to ‘Ogre::WindowEventUtilities::addWindowEventListener(Ogre::RenderWindow*&, BaseApplication* const)’
/home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:118:69: note: candidate is:
In file included from /home/mushmula/Плот/clean_ogre_cmake_project/BaseApplication.cpp:20:0:
/usr/local/include/OGRE/OgreWindowEventUtilities.h:142:21: note: static void Ogre::WindowEventUtilities::addWindowEventListener(Ogre::RenderWindow*, Ogre::WindowEventListener*)
/usr/local/include/OGRE/OgreWindowEventUtilities.h:142:21: note:   no known conversion for argument 2 from ‘BaseApplication* const’ to ‘Ogre::WindowEventListener*’
make[2]: *** [CMakeFiles/OgreApp.dir/BaseApplication.cpp.o] Error 1
make[1]: *** [CMakeFiles/OgreApp.dir/all] Error 2
make: *** [all] Error 2
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Can not build Ogre3D 1.9 project with CMake on Linux.

Post by c6burns »

Sorry I meant to say add those includes in BaseApplication.h (not cpp). Add them above the declaration for class BaseApplication (since it derives from Ogre::WindowEventListener). That should fix it :)
User avatar
50cent2513
Gnoblar
Posts: 3
Joined: Thu Aug 07, 2014 1:00 pm

Re: Can not build Ogre3D 1.9 project with CMake on Linux.

Post by 50cent2513 »

c6burns wrote:Sorry I meant to say add those includes in BaseApplication.h (not cpp). Add them above the declaration for class BaseApplication (since it derives from Ogre::WindowEventListener). That should fix it :)
It works now. Thank you so much!
Post Reply