Setting Ogre dir on Linux

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Fdot
Just popping in
Just popping in
Posts: 8
Joined: Wed Sep 22, 2010 10:24

Setting Ogre dir on Linux

Postby Fdot » Wed Sep 22, 2010 10:27

Hi,

maybe this is a really nooby question, but i don't know where to set the Ogre3D path when I build CEGUI.

I found that page:
http://www.cegui.org.uk/wiki/index.php/ ... reRenderer

And I set the paths there, but when i run ./configure the changes don't work. So is configure.lua only for windows or did I do it wrong?

Thanks, Fdot

Edit: I also tried running bootstrap:

~/Downloads/CEGUI-0.7.2$ ./bootstrap
libtoolize: putting auxiliary files in `.'.
libtoolize: linking file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

Automake 1.9 and Autoconf are installed.

User avatar
emarcotte
Quite a regular
Quite a regular
Posts: 55
Joined: Fri Dec 26, 2008 14:30
Contact:

Re: Setting Ogre dir on Linux

Postby emarcotte » Wed Sep 22, 2010 13:04

The lua build stuff is for premake which is for windows (as far as I've ever used it, anyway)

For linux, use the autoconf things like you have. What you need to do to find ogre is either use pkg-config or use Ogre_CFLAGS and Ogre_LIBS (I forget the exact names, but something like that).

Using pkg-config is vastly better. To do it, what you need to do is type pkg-config OGRE --cflags. If you get output, then you can just run ./configure with whatever other options you want.

If you don't get output, you need to update PKG_CONFIG_PREFIX e.g. export PKG_CONFIG_PREFIX=/path/to/where/ogre/lib/pkgconfig is.

You've probably seen http://www.cegui.org.uk/wiki/index.php/ ... subversion, but that's a good guide.

Fdot
Just popping in
Just popping in
Posts: 8
Joined: Wed Sep 22, 2010 10:24

Re: Setting Ogre dir on Linux

Postby Fdot » Wed Sep 22, 2010 13:54

Thanks for your answer. Yeah that helped. But I think that PKG_CONFIG_PATH is the right one? After using that it works. The problem is that this overwrites the path and doesn't add a new one. I have OIS installed also. So i copied the OGRE.pc and OIS.pc file to /usr/lib/pkgconfig and it runs.

Fdot
Just popping in
Just popping in
Posts: 8
Joined: Wed Sep 22, 2010 10:24

Re: Setting Ogre dir on Linux

Postby Fdot » Wed Sep 22, 2010 14:12

Okay another problem. Now he doesn't find boost (is needed for OGRE). In boost is no boost.pc. I wrote one by myself, but that doesn't work. How can I solve this?

IR3uL
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Aug 25, 2010 00:32
Location: Buenos Aires - Argentina

Re: Setting Ogre dir on Linux

Postby IR3uL » Wed Sep 22, 2010 16:20

Fdot wrote:Thanks for your answer. Yeah that helped. But I think that PKG_CONFIG_PATH is the right one? After using that it works. The problem is that this overwrites the path and doesn't add a new one. I have OIS installed also. So i copied the OGRE.pc and OIS.pc file to /usr/lib/pkgconfig and it runs.


This is from pkg-config man page:
pkg-config retrieves information about packages from special metadata files. These files are named after the package, with the extension .pc. By default, pkg-config looks in the directory prefix/lib/pkgconfig for these files; it will also look in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment variable.


man is you friend =D

User avatar
emarcotte
Quite a regular
Quite a regular
Posts: 55
Joined: Fri Dec 26, 2008 14:30
Contact:

Re: Setting Ogre dir on Linux

Postby emarcotte » Wed Sep 22, 2010 23:46

yeah sorry i meant _PATH, I was at work and not in front of a real computer to test it :)

Fdot
Just popping in
Just popping in
Posts: 8
Joined: Wed Sep 22, 2010 10:24

Re: Setting Ogre dir on Linux

Postby Fdot » Wed Oct 06, 2010 14:03

Fdot wrote:Okay another problem. Now he doesn't find boost (is needed for OGRE). In boost is no boost.pc. I wrote one by myself, but that doesn't work. How can I solve this?


okay I solved this too, by editin my OGRE.pc file:

prefix=/home/michi/workspace/i6m2etis/dependencies/Ogre3D/
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
plugindir=${libdir}/OGRE

Name: OGRE
Description: Object-Oriented Graphics Rendering Engine
Version: 1.7.1
URL: http://www.ogre3d.org
Libs: -L${libdir} -lOgreMain -lpthread -L/home/michi/workspace/i6m2etis/dependencies/Boost_1_43/lib -lboost_thread -lboost_filesystem -lboost_system -lboost_date_time
Cflags: -I${includedir} -I${includedir}/OGRE -pthread -I/home/michi/workspace/i6m2etis/dependencies/Boost_1_43/include/boost -I/home/michi/workspace/i6m2etis/dependencies/Boost_1_43/include


So the boost problem is gone. When I run make I got errors, that the compiler doesn't find Ogre:

Code: Select all

Making all in Demo6
make[2]: Entering directory `/home/michi/Downloads/CEGUI-0.7.2/Samples/Demo6'
/bin/bash ../../libtool --tag=CXX   --mode=link g++  -g -O2   -o Demo6 Demo6-Sample_Demo6.o ../../cegui/src/libCEGUIBase.la ../../Samples/common/src/libCEGUISampleHelper.la  -lpthread -ldl
libtool: link: g++ -g -O2 -o .libs/Demo6 Demo6-Sample_Demo6.o  ../../cegui/src/.libs/libCEGUIBase.so ../../Samples/common/src/.libs/libCEGUISampleHelper.so -lpthread -ldl
/usr/bin/ld: warning: libOgreMain.so.1.7.1, needed by ../../Samples/common/src/.libs/libCEGUISampleHelper.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_thread.so.1.43.0, needed by ../../Samples/common/src/.libs/libCEGUISampleHelper.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_filesystem.so.1.43.0, needed by ../../Samples/common/src/.libs/libCEGUISampleHelper.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_system.so.1.43.0, needed by ../../Samples/common/src/.libs/libCEGUISampleHelper.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libboost_date_time.so.1.43.0, needed by ../../Samples/common/src/.libs/libCEGUISampleHelper.so, not found (try using -rpath or -rpath-link)
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Root::Root(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::StringUtil::BLANK'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Root::createSceneManager(unsigned short, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Root::~Root()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Quaternion::operator*(Ogre::Quaternion const&) const'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Image::~Image()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Image::getData()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Math::fDeg2Rad'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::ResourceGroupManager::findResourceNames(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Matrix4::inverse() const'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::ResourceGroupManager::createResourceGroup(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::ColourValue::White'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::TextureManager::getSingleton()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::VertexData::~VertexData()'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Root::startRendering()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Viewport::getTarget() const'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Viewport::Viewport(Ogre::Camera*, Ogre::RenderTarget*, float, float, float, float, int)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Root::getAutoCreatedWindow()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Matrix4::IDENTITY'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Viewport::getActualWidth() const'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Image::getHeight() const'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Root::initialise(bool, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Camera::lookAt(Ogre::Vector3 const&)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Image::getWidth() const'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Quaternion::ToRotationMatrix(Ogre::Matrix3&) const'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Viewport::getActualHeight() const'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Image::Image()'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `typeinfo for Ogre::Exception'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Image::getRowSpan() const'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Vector3::UNIT_Y'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Image::getFormat() const'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Image::load(Ogre::SharedPtr<Ogre::DataStream>&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Quaternion::FromAngleAxis(Ogre::Radian const&, Ogre::Vector3 const&)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::VertexData::VertexData(Ogre::HardwareBufferManagerBase*)'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::ResourceGroupManager::addResourceLocation(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Vector3::UNIT_Z'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::ResourceGroupManager::getSingleton()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Viewport::setDimensions(float, float, float, float)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Matrix4::ZERO'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::ResourceGroupManager::initialiseAllResourceGroups()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::HardwareBufferManager::getSingleton()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Root::getSingletonPtr()'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::WindowEventUtilities::addWindowEventListener(Ogre::RenderWindow*, Ogre::WindowEventListener*)'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Viewport::setBackgroundColour(Ogre::ColourValue const&)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Vector3::UNIT_X'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Root::removeFrameListener(Ogre::FrameListener*)'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Root::showConfigDialog()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::ResourceGroupManager::openResource(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, Ogre::Resource*)'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Root::addFrameListener(Ogre::FrameListener*)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::VertexElement::getTypeSize(Ogre::VertexElementType)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Matrix3::ZERO'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Root::getRenderSystem()'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::Viewport::_updateDimensions()'
../../Samples/common/src/.libs/libCEGUISampleHelper.so: undefined reference to `Ogre::Camera::setPosition(Ogre::Vector3 const&)'
/home/michi/Downloads/CEGUI-0.7.2/cegui/src/RendererModules/Ogre/.libs/libCEGUIOgreRenderer-0.7.2.so: undefined reference to `Ogre::MemoryDataStream::MemoryDataStream(void*, unsigned long, bool, bool)'
collect2: ld returned 1 exit status
make[2]: *** [Demo6] Error 1
make[2]: Leaving directory `/home/michi/Downloads/CEGUI-0.7.2/Samples/Demo6'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/michi/Downloads/CEGUI-0.7.2/Samples'
make: *** [all-recursive] Error 1


Do I have to set Ogre somewhere else?

Fdot
Just popping in
Just popping in
Posts: 8
Joined: Wed Sep 22, 2010 10:24

Re: Setting Ogre dir on Linux

Postby Fdot » Thu Oct 07, 2010 09:41

Sry for second post.

Maybe it is possible to deactivate the samples, but I'm not sure if there are problems later in using the gui?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Setting Ogre dir on Linux

Postby CrazyEddie » Fri Oct 08, 2010 09:32

you can deactivate the samples by passing --disable-samples to configure. However, I do think that you will experience the same issues when linking to your own code later on.

Clearly there is an issue with the Ogre libs not being linked correctly. If you are doing non-standard stuff (and by that I mean anything that requires you to manually edit the Ogre.pc file), you're in 'advanced territory' and what and how you do it will depend on your specific system and set up - and that's very difficult to give specific advice.

Can you post (or upload somewhere) the config.log file produced from the configure script? I can't promise it will help anyone spot the exact issue, but it would give clues as to your system set up.

CE.

Fdot
Just popping in
Just popping in
Posts: 8
Joined: Wed Sep 22, 2010 10:24

Re: Setting Ogre dir on Linux

Postby Fdot » Fri Oct 08, 2010 12:59

The config.log:
http://pastebin.com/dzBvPwbL

I build Ogre and Bullet by myself. The .pc file was the same without Boost as I posted it. I only changed the paths.

My environment, maybe it helps:

i6m2etis/dependencies/Boost_1_43/include/boost
i6m2etis/dependencies/Boost_1_43/lib
i6m2etis/dependencies/Ogre3D/include/OGRE
i6m2etis/dependencies/Ogre3D/lib

Boost v. 1.43
Ogre3D v. 1.7.1

The project works fine. So I think that I build boost and ogre correctly before.

Fdot
Just popping in
Just popping in
Posts: 8
Joined: Wed Sep 22, 2010 10:24

Re: Setting Ogre dir on Linux

Postby Fdot » Mon Oct 11, 2010 14:37

Okay I think i got it. The problem was - as you mentioned - that Ogre wasn't link correctly. So I took a look at the Makefiles of the samples. There was the Ogre variables correctly filled:

Ogre_CFLAGS = -pthread -I/home/michi/workspace/i6m2etis/dependencies/Ogre3D/include -I/home/michi/workspace/i6m2etis/dependencies/Ogre3D/include/OGRE -I/home/michi/workspace/i6m2etis/dependencies/Boost_1_43/include/boost -I/home/michi/workspace/i6m2etis/dependencies/Boost_1_43/include
Ogre_LIBS = -L/home/michi/workspace/i6m2etis/dependencies/Ogre3D/lib -L/home/michi/workspace/i6m2etis/dependencies/Boost_1_43/lib -lOgreMain -lpthread -lboost_thread -lboost_filesystem -lboost_system -lboost_date_time


But the Makefile ignored this (or the linker). So editet following two lines (the first about line 60 the second about 132) :

DEFAULT_INCLUDES = -I. -I$(top_builddir)/cegui/include
LIBS = -lpthread -ldl


to

DEFAULT_INCLUDES = -I. -I$(top_builddir)/cegui/include $(Ogre_CFLAGS)
LIBS = -lpthread -ldl $(Ogre_LIBS)


and it works. (Nice work to do this with all samples ;) )

Now it throws some errors by initializing (got two viewports) but I think I'll google a bit and maybe start a new thread ;)
Thanks for your time.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Setting Ogre dir on Linux

Postby CrazyEddie » Wed Oct 13, 2010 09:33

I develop primarily on linux, and the build works fine for me when building with Ogre.

For reference, the output of my pkg-config calls are:

Code: Select all

$ pkg-config --libs OGRE
-L/usr/local/lib -lOgreMain -lpthread

and

Code: Select all

$ pkg-config --cflags OGRE
-pthread -I/usr/local/include -I/usr/local/include/OGRE

i.e. no mention of boost libs at all

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 7 guests