FreeOrion

Forums for the FreeOrion project
It is currently Sat May 25, 2013 6:19 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Compiling GG fails with ‘_op’ cannot be declared ‘mutable’
PostPosted: Tue Aug 02, 2011 8:05 pm 
Offline
Space Floater
User avatar

Joined: Sat Mar 24, 2007 8:28 am
Posts: 18
Hello World,

When I try to compile libGiGi within my project, compiling fails at 40%

Code:
[ 40%] Building CXX object src/CMakeFiles/GiGi.dir/Texture.cpp.o
In file included from /home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/GIL/extension/io/../dynamic_image/apply_operation.hpp:25:0,
                 from /home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/GIL/extension/io/../dynamic_image/dynamic_image_all.hpp:28,
                 from /home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/GIL/extension/io/jpeg_dynamic_io.hpp:28,
                 from /home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/Texture.cpp:38:
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/GIL/extension/io/../dynamic_image/apply_operation_base.hpp:121:22: error: reference ‘_op’ cannot be declared ‘mutable’ [-fpermissive]
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/GIL/extension/io/../dynamic_image/apply_operation_base.hpp:134:22: error: reference ‘_op’ cannot be declared ‘mutable’ [-fpermissive]
make[4]: *** [src/CMakeFiles/GiGi.dir/Texture.cpp.o] Fehler 1
oir_work/3rdParty/GG'
make[3]: *** [src/CMakeFiles/GiGi.dir/all] Fehler 2
make[3]: Leaving directory `/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG'
make[2]: *** [all] Fehler 2
make[2]: Leaving directory `/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG'
make[1]: *** [GG/libGiGi.so] Fehler 2
make[1]: Leaving directory `/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty'
make: *** [all-recursive] Fehler 1


Compiler:
Code:
andy@shannara:~/Programming/Projects/OilImperiumReloaded/oir_work$ gcc --version
gcc (Debian 4.6.1-5) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Do I miss something or what's the problem here?

TIA and best regards
Andreas aka SF


Top
 Profile  
 
 Post subject: Re: Compiling GG fails with ‘_op’ cannot be declared ‘mutabl
PostPosted: Tue Aug 02, 2011 11:08 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7898
Location: Vancouver, BC
Looks like GCC decided something shouldn't compile that used to. Try removing the "mutable" from the lines with the errors in apply_operation_base.hpp


Top
 Profile  
 
 Post subject: Re: Compiling GG fails with ‘_op’ cannot be declared ‘mutabl
PostPosted: Thu Aug 04, 2011 4:48 pm 
Offline
Space Floater
User avatar

Joined: Sat Mar 24, 2007 8:28 am
Posts: 18
Thank you. After having removed these two 'mutable's, it compiles up to 56%:

Code:
[ 56%] Building CXX object src/CMakeFiles/GiGi.dir/adobe/any_regular.cpp.o
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp: In instantiation of ‘const adobe::implementation::serializable<bool> adobe::implementation::make_serializable<bool>::value’:
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:84:65:   instantiated from here
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:65:23: error: uninitialized const ‘adobe::implementation::make_serializable<bool>::value’ [-fpermissive]
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:54:8: note: ‘const struct adobe::implementation::serializable<bool>’ has no user-provided default constructor
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp: In instantiation of ‘const adobe::implementation::serializable<adobe::version_1::closed_hash_map<adobe::version_1::name_t, adobe::version_1::any_regular_t> > adobe::implementation::make_serializable<adobe::version_1::closed_hash_map<adobe::version_1::name_t, adobe::version_1::any_regular_t> >::value’:
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:85:81:   instantiated from here
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:65:23: error: uninitialized const ‘adobe::implementation::make_serializable<adobe::version_1::closed_hash_map<adobe::version_1::name_t, adobe::version_1::any_regular_t> >::value’ [-fpermissive]
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:54:8: note: ‘const struct adobe::implementation::serializable<adobe::version_1::closed_hash_map<adobe::version_1::name_t, adobe::version_1::any_regular_t> >’ has no user-provided default constructor
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp: In instantiation of ‘const adobe::implementation::serializable<double> adobe::implementation::make_serializable<double>::value’:
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:86:69:   instantiated from here
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:65:23: error: uninitialized const ‘adobe::implementation::make_serializable<double>::value’ [-fpermissive]
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:54:8: note: ‘const struct adobe::implementation::serializable<double>’ has no user-provided default constructor
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp: In instantiation of ‘const adobe::implementation::serializable<adobe::version_1::empty_t> adobe::implementation::make_serializable<adobe::version_1::empty_t>::value’:
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:87:71:   instantiated from here
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:65:23: error: uninitialized const ‘adobe::implementation::make_serializable<adobe::version_1::empty_t>::value’ [-fpermissive]
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:54:8: note: ‘const struct adobe::implementation::serializable<adobe::version_1::empty_t>’ has no user-provided default constructor
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp: In instantiation of ‘const adobe::implementation::serializable<adobe::version_1::name_t> adobe::implementation::make_serializable<adobe::version_1::name_t>::value’:
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:88:69:   instantiated from here
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:65:23: error: uninitialized const ‘adobe::implementation::make_serializable<adobe::version_1::name_t>::value’ [-fpermissive]
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:54:8: note: ‘const struct adobe::implementation::serializable<adobe::version_1::name_t>’ has no user-provided default constructor
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp: In instantiation of ‘const adobe::implementation::serializable<adobe::version_1::string_t> adobe::implementation::make_serializable<adobe::version_1::string_t>::value’:
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:89:73:   instantiated from here
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:65:23: error: uninitialized const ‘adobe::implementation::make_serializable<adobe::version_1::string_t>::value’ [-fpermissive]
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:54:8: note: ‘const struct adobe::implementation::serializable<adobe::version_1::string_t>’ has no user-provided default constructor
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp: In instantiation of ‘const adobe::implementation::serializable<adobe::version_1::vector<adobe::version_1::any_regular_t> > adobe::implementation::make_serializable<adobe::version_1::vector<adobe::version_1::any_regular_t> >::value’:
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:90:71:   instantiated from here
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:65:23: error: uninitialized const ‘adobe::implementation::make_serializable<adobe::version_1::vector<adobe::version_1::any_regular_t> >::value’ [-fpermissive]
/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG/src/adobe/any_regular.cpp:54:8: note: ‘const struct adobe::implementation::serializable<adobe::version_1::vector<adobe::version_1::any_regular_t> >’ has no user-provided default constructor
make[4]: *** [src/CMakeFiles/GiGi.dir/adobe/any_regular.cpp.o] Fehler 1
make[4]: Leaving directory `/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG'
make[3]: *** [src/CMakeFiles/GiGi.dir/all] Fehler 2
make[3]: Leaving directory `/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG'
make[2]: *** [all] Fehler 2
make[2]: Leaving directory `/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty/GG'
make[1]: *** [GG/libGiGi.so] Fehler 2
make[1]: Leaving directory `/home/andy/Programming/Projects/OilImperiumReloaded/oir_work/3rdParty'
make: *** [all-recursive] Fehler 1


Anyone any idea, what's happening?

(Patch for the first problem attached)


Attachments:
File comment: Patch to remove 'mutable' (and some whitespaces)
libGiGi-mutable.patch [3.57 KiB]
Downloaded 16 times
Top
 Profile  
 
 Post subject: Re: Compiling GG fails with ‘_op’ cannot be declared ‘mutabl
PostPosted: Thu Aug 04, 2011 4:54 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7898
Location: Vancouver, BC
What's happening is that GCC 4.6 decided that classes without user-defined default constructors can't be default initialized. See also here.

The easiest fix is probably just to remove all the adobe stuff from the GiGi build; it's not needed to use GiGi.


Top
 Profile  
 
 Post subject: Re: Compiling GG fails with ‘_op’ cannot be declared ‘mutabl
PostPosted: Thu Aug 04, 2011 8:36 pm 
Offline
Space Floater
User avatar

Joined: Sat Mar 24, 2007 8:28 am
Posts: 18
Geoff the Medio wrote:

[...]
The easiest fix is probably just to remove all the adobe stuff from the GiGi build; it's not needed to use GiGi.


What's the adobe stuff for, then?


Top
 Profile  
 
 Post subject: Re: Compiling GG fails with ‘_op’ cannot be declared ‘mutabl
PostPosted: Sat Aug 27, 2011 11:46 am 
Offline
Space Floater
User avatar

Joined: Sat Mar 24, 2007 8:28 am
Posts: 18
Geoff the Medio wrote:
What's happening is that GCC 4.6 decided that classes without user-defined default constructors can't be default initialized. See also here.


I finally managed to compile rev 1043 with gcc-4.6. Attached is the patch with my changes. Please apply!

Best regards StarFire


Attachments:
File comment: Patch to make libGigi compile with GCC 4.6
libGiGi-gcc-4.6.patch [1.66 KiB]
Downloaded 44 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group