Compilation fails on Debian Wheezy

Found a bug? Report it here.

Moderator: PPS-Leaders

Post Reply
User avatar
Nowic
Thanathon, God of the lower Planes
Posts: 186
Joined: Tue Oct 03, 2006 7:53 pm
Location: Zürich
Contact:

Compilation fails on Debian Wheezy

Post by Nowic » Tue Oct 08, 2013 9:29 pm

Hi,

The current trunk does not compile on Debian 7.0 (Wheezy) 64bit. I get a weird message about an already declared symbol.

[ 2%] Building CXX object src/libraries/core/CMakeFiles/core.dir/OgreBuildUnit.cc.o
In file included from /usr/include/boost/filesystem.hpp:35:0,
from /home/simon/Projekte/orxonox_new/trunk/src/libraries/core/GraphicsManager.cc:35,
from /home/simon/Projekte/orxonox_new/trunk/build/src/libraries/core/OgreBuildUnit.cc:1:
/usr/include/boost/filesystem/v3/path.hpp:732:24: error: ‘path’ is already declared in this scope

libogre 1.7.4
libboost-filesystem 1.49.0

Cheers
Simon
"I've always lived cheaply. I live like a student, basically. And I like that because it means that money is not telling me what to do. I can do what I think is important for me to do. It freed me to do what seemed worth doing." -- Richard Stallman

User avatar
beni
Baron Vladimir Harkonnen
Posts: 949
Joined: Tue Oct 03, 2006 9:15 am
Location: Zurich
Contact:

Re: Compilation fails on Debian Wheezy

Post by beni » Wed Oct 09, 2013 1:29 pm

Hey Nowic,

you're back! Thanks for trying to make it work on Debian. I don't think we had somebody compiling it for Debian in a while now.

The error message you have is weird indeed. Looks like the boost library is incompatible with Ogre, but weird that we don't have the same problem on other systems.

Thanks for letting us know. Looking forward seeing you on November 2nd.
"I'm Commander Shepard and this is my favorite forum on the internet."

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Re: Compilation fails on Debian Wheezy

Post by x3n » Wed Oct 09, 2013 7:14 pm

Hi Nowic

Have a look at src/libraries/core/CorePrereqs.h between lines 266 and 318. There we make some forward declarations of some important classes in the boost namespace, including 'path' (for your version of boost this is probably on line 296 and 300). Even though it shouldn't, these may collide with the actual declaration in the boost headers.

You could try to
  • Look at the actual declaration in /usr/include/boost/filesystem/v3/path.hpp:732 and look for differences between this declaration and the forward declaration in CorePrereqs.h. If they differ, adjust the code in CorePrereqs.h accordingly
  • Remove the forward declaration in CorePrereqs.h (this could result in other compiler errors)
Fabian 'x3n' Landau, Orxonox developer

User avatar
Nowic
Thanathon, God of the lower Planes
Posts: 186
Joined: Tue Oct 03, 2006 7:53 pm
Location: Zürich
Contact:

Re: Compilation fails on Debian Wheezy

Post by Nowic » Mon Oct 14, 2013 8:57 pm

Thank you for your suggestions. The following patch fixes the issue.

Reference for the change: http://www.boost.org/doc/libs/1_49_0/li ... /index.htm

Should I commit it? (If I still have the rights to do it...)

Code: Select all

Index: src/libraries/core/CorePrereqs.h
===================================================================
--- src/libraries/core/CorePrereqs.h	(Revision 9702)
+++ src/libraries/core/CorePrereqs.h	(Arbeitskopie)
@@ -299,15 +299,18 @@
     {
         using filesystem3::path;
     }
-# endif
+#endif
 
 #else
-
-    // TODO: Check this once boost 1.48 is released
-    namespace filesystem
+    // 1.48 and newer includes version 3 only
+    namespace filesystem3
     {
         class path;
     }
+    namespace filesystem
+    {
+        using filesystem3::path;
+    }
 
 #endif
 
"I've always lived cheaply. I live like a student, basically. And I like that because it means that money is not telling me what to do. I can do what I think is important for me to do. It freed me to do what seemed worth doing." -- Richard Stallman

User avatar
beni
Baron Vladimir Harkonnen
Posts: 949
Joined: Tue Oct 03, 2006 9:15 am
Location: Zurich
Contact:

Re: Compilation fails on Debian Wheezy

Post by beni » Mon Oct 14, 2013 9:36 pm

Commit it. We can still roll it back if it breaks something else. It's a very small change anyway. Good work! Somebody ran into the same problem on Ubuntu 13.04 just today. If you could commit it, it might fix his problem as well.
"I'm Commander Shepard and this is my favorite forum on the internet."

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Re: Compilation fails on Debian Wheezy

Post by x3n » Tue Oct 15, 2013 8:53 pm

Thanks for testing. I compared boost versions from 1.47 up to 1.54 and noticed that we only have to change the version number in the preprocessor statement to fix the issue (boost versions 1.48 and 1.49 were affected).

http://www.orxonox.net/changeset/9703
Fabian 'x3n' Landau, Orxonox developer

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests