Compile problem on Ubuntu 9.04 with Ogre-head [solved+patch]

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
boban
Space Krill
Posts: 2
Joined: Wed Aug 12, 2009 8:23 pm
Location: Poland

Compile problem on Ubuntu 9.04 with Ogre-head [solved+patch]

#1 Post by boban »

Hi all!

I recently found out about FreeOrion project. I tried to compile it under Ubuntu 9.04. So far I am impressed by the project. Nevertheless, following linux-compile howto on FreeOrion Wiki I stumbled upon two compile errors. They were easy to fix. Two file needed small tweaks: in UI/PagedGeometry/PagedGeometry.cpp call to map was ambigous, in client/human/chmain.cpp call to root->getAvailableRenderers() returns const reference instead of pointer (in rev. 8962 of Ogre3D). Here is svn diff:

Code: Select all

Index: UI/PagedGeometry/PagedGeometry.cpp
===================================================================
--- UI/PagedGeometry/PagedGeometry.cpp  (wersja 3118)
+++ UI/PagedGeometry/PagedGeometry.cpp  (kopia robocza)
@@ -371,7 +371,7 @@

 float PagedGeometry::getCustomParam(string paramName, float defaultParamValue) const
 {
-       map<string, float>::const_iterator it;
+       std::map<string, float>::const_iterator it;
        it = customParam.find(paramName);
        if (it != customParam.end()) {
                float x = it->second;
Index: client/human/chmain.cpp
===================================================================
--- client/human/chmain.cpp     (wersja 3118)
+++ client/human/chmain.cpp     (kopia robocza)
@@ -187,11 +187,11 @@
         root->installPlugin(gl_plugin);
 #endif

-        RenderSystemList* renderers_list = root->getAvailableRenderers();
+               const RenderSystemList &renderers_list = root->getAvailableRenderers();
         bool failed = true;
         RenderSystem* selected_render_system = 0;
-        for (unsigned int i = 0; i < renderers_list->size(); ++i) {
-            selected_render_system = renderers_list->at(i);
+        for (unsigned int i = 0; i < renderers_list.size(); ++i) {
+            selected_render_system = renderers_list.at(i);
             String name = selected_render_system->getName();
             if (name.compare("OpenGL Rendering Subsystem") == 0) {
                 failed = false;

I hope this diff will help other compiling FreeOrion on Ubuntu.

Best regards,
bOBaN

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compile problem on Ubuntu 9.04 with Ogre-head [solved+patch]

#2 Post by Geoff the Medio »

boban wrote:I stumbled upon two compile errors. They were easy to fix.
Thanks for the post.

Apparently there have been some changes between Ogre 1.6.1 and the latest version that are causing these errors. I'll add a link to this thread in the wiki.

Post Reply