Compiling 4066 on ArchLinux x86_64 yields compilation error

Questions, problems and discussion about compiling FreeOrion.

Moderators: Oberlus, Oberlus

Post Reply
Message
Author
Jonhoo
Space Krill
Posts: 1
Joined: Sun Jul 24, 2011 7:03 pm

Compiling 4066 on ArchLinux x86_64 yields compilation error

#1 Post by Jonhoo » Sun Jul 24, 2011 7:07 pm

Hi all,

I'm new to FreeOrion, but would really like to try it out.
Unfortunately, there is no pre-built package for x86_64 on ArchLinux, so I'm trying to compile from the latest svn version (4066).
However, it is not working... Every time I compile, I receive a heap of warnings, and one error that stops the whole thing:

Code: Select all

/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/universe/ParserUtil.cpp:13:12: error: uninitialized const ‘skip_p’ [-fpermissive]
The full compilation log is given below.

Any help would be greatly appreciated!
Jon

Code: Select all

[  0%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/CombatOrder.cpp.o
[  0%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/OpenSteer/AsteroidBeltObstacle.cpp.o
[  1%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/OpenSteer/CombatFighter.cpp.o
[  1%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/OpenSteer/CombatObject.cpp.o
[  1%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/OpenSteer/CombatShip.cpp.o
[  2%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/OpenSteer/Missile.cpp.o
[  2%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/OpenSteer/Obstacle.cpp.o
[  2%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/OpenSteer/PathingEngine.cpp.o
[  3%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/OpenSteer/SimpleVehicle.cpp.o
[  3%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/OpenSteer/Vec3.cpp.o
[  3%] Building CXX object server/CMakeFiles/freeoriond.dir/__/combat/OpenSteer/Vec3Utilities.cpp.o
[  4%] Building CXX object server/CMakeFiles/freeoriond.dir/__/Empire/Empire.cpp.o
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/Empire/Empire.cpp: In constructor ‘{anonymous}::AlignmentManager::AlignmentManager()’:
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/Empire/Empire.cpp:1062:66: warning: unused variable ‘p’ [-Wunused-variable]
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/Empire/Empire.cpp: In member function ‘void Empire::InitResourcePools()’:
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/Empire/Empire.cpp:2841:35: warning: unused variable ‘rc’ [-Wunused-variable]
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/Empire/Empire.cpp:2843:30: warning: unused variable ‘pc’ [-Wunused-variable]
[  4%] Building CXX object server/CMakeFiles/freeoriond.dir/__/Empire/EmpireManager.cpp.o
[  4%] Building CXX object server/CMakeFiles/freeoriond.dir/__/Empire/ResourcePool.cpp.o
[  5%] Building CXX object server/CMakeFiles/freeoriond.dir/__/network/Message.cpp.o
[  5%] Building CXX object server/CMakeFiles/freeoriond.dir/__/network/MessageQueue.cpp.o
[  5%] Building CXX object server/CMakeFiles/freeoriond.dir/__/network/Networking.cpp.o
[  5%] Building CXX object server/CMakeFiles/freeoriond.dir/__/UI/StringTable.cpp.o
[  6%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/Building.cpp.o
[  6%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/Condition.cpp.o
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/universe/Condition.cpp: In function ‘void {anonymous}::TransferSortedObjects(unsigned int, const ValueRef::ValueRefBase<double>*, const ScriptingContext&, Condition::SortingMethod, Condition::ObjectSet&, Condition::ObjectSet&)’:
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/universe/Condition.cpp:358:89: warning: variable ‘key_range’ set but not used [-Wunused-but-set-variable]
[  6%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/ConditionParser1.cpp.o
[  7%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/ConditionParser2.cpp.o
[  7%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/ConditionParser.cpp.o
[  7%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/Effect.cpp.o
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/universe/Effect.cpp: In member function ‘virtual void Effect::MoveTo::Execute(const ScriptingContext&) const’:
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/universe/Effect.cpp:1738:20: warning: variable ‘new_fleet’ set but not used [-Wunused-but-set-variable]
[  8%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/EffectParser.cpp.o
[  8%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/Enums.cpp.o
[  8%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/Fleet.cpp.o
[  9%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/Meter.cpp.o
[  9%] Building CXX object server/CMakeFiles/freeoriond.dir/__/universe/ParserUtil.cpp.o
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/universe/ParserUtil.cpp:13:12: error: uninitialized const ‘skip_p’ [-fpermissive]
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/universe/Parser.h:44:8: note: ‘const struct Skip’ has no user-provided default constructor
/tmp/yaourt-tmp-jon/aur-freeorion-svn/src/freeorion-build/universe/ParserUtil.cpp:147:10: warning: ‘{anonymous}::dummy’ defined but not used [-Wunused-variable]
make[2]: *** [server/CMakeFiles/freeoriond.dir/__/universe/ParserUtil.cpp.o] Error 1
make[1]: *** [server/CMakeFiles/freeoriond.dir/all] Error 2
make: *** [all] Error 2

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

Re: Compiling 4066 on ArchLinux x86_64 yields compilation er

#2 Post by Geoff the Medio » Sun Jul 24, 2011 8:16 pm

The warnings mostly aren't a concern, although one you posted did point me to a logic bug in a condition.

The error is odd... The line in question should be default-initializing skip_p. I'm guessing this is a quirk of GCC 4.6? (Edit: googling seems to confirm this, and the suggested fix below... /Edit)

Try changing it to:

Code: Select all

const Skip skip_p = Skip()

Post Reply