'SaveGamePreviewUtils.cpp: path' is already declared

Questions, problems and discussion about compiling FreeOrion.

Moderators: Oberlus, Oberlus

Post Reply
Message
Author
User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

'SaveGamePreviewUtils.cpp: path' is already declared

#1 Post by Nagilum » Fri May 09, 2014 5:43 pm

I just tried building FO svn 7115 but it fails with this error:

Code: Select all

Building CXX object CMakeFiles/freeorioncommon.dir/util/SaveGamePreviewUtils.cpp.o
/usr/bin/c++   -DFREEORION_BUILD_COMMON -DFREEORION_LINUX -DENABLE_BINRELOC -Wno-deprecated -Wall -Wno-parentheses -fPIC -I/tmp/buildd/freeorion-0.4.3+svn7115/FreeOrion -I/tmp/buildd/freeorion-0.4.3+svn7115/FreeOrion/GG -I/tmp/buildd/freeorion-0.4.3+svn7115/FreeOrion/log4cpp -I/tmp/buildd/freeorion-0.4.3+svn7115/FreeOrion/OpenSteer/include    -fvisibility=hidden -o CMakeFiles/freeorioncommon.dir/util/SaveGamePreviewUtils.cpp.o -c /tmp/buildd/freeorion-0.4.3+svn7115/FreeOrion/util/SaveGamePreviewUtils.cpp
In file included from /usr/include/boost/filesystem/path.hpp:31:0,
                 from /tmp/buildd/freeorion-0.4.3+svn7115/FreeOrion/util/../util/Directories.h:5,
                 from /tmp/buildd/freeorion-0.4.3+svn7115/FreeOrion/util/SaveGamePreviewUtils.cpp:8:
/usr/include/boost/filesystem/v3/path.hpp:732:24: error: 'path' is already declared in this scope
make[2]: *** [CMakeFiles/freeorioncommon.dir/util/SaveGamePreviewUtils.cpp.o] Error 1
make[2]: Leaving directory `/tmp/buildd/freeorion-0.4.3+svn7115/FreeOrion'
make[1]: *** [CMakeFiles/freeorioncommon.dir/all] Error 2
make[1]: Leaving directory `/tmp/buildd/freeorion-0.4.3+svn7115/FreeOrion'
make: *** [all] Error 2
Looking at the history it seems commit 7107 could be the culprit.

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

Re: 'SaveGamePreviewUtils.cpp: path' is already declared

#2 Post by Geoff the Medio » Sun May 11, 2014 7:29 pm

I don't get that error, so you or someone else trying to build on Linux would need to try to locate the offending declaration...

Or, try removing

Code: Select all

namespace boost { namespace filesystem { class path; } }
namespace boost { namespace serialization { class access; } }
from SaveGamePreviewUtils.h and, if necessary, replacing with #include "Directories.h"?

User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

Re: 'SaveGamePreviewUtils.cpp: path' is already declared

#3 Post by Nagilum » Mon May 12, 2014 8:38 am

Thanks!
That does indeed solve the issue (patch attached). Does it then still compile on Windows?
Attachments

[The extension patch has been deactivated and can no longer be displayed.]


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

Re: 'SaveGamePreviewUtils.cpp: path' is already declared

#4 Post by Geoff the Medio » Mon May 12, 2014 9:22 pm

SaveGamePreviewUtils.cpp still builds. Haven't built the whole thing, but it's probably OK.

User avatar
Nagilum
Release Manager, Design
Posts: 212
Joined: Thu Dec 31, 2009 3:25 pm
Location: Germany

Re: 'SaveGamePreviewUtils.cpp: path' is already declared

#5 Post by Nagilum » Tue May 13, 2014 5:39 am

Thanks!
Committed.

Post Reply