UI/MapWnd.cpp:800:143: error: cannot call constructor 'GG::S

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

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

UI/MapWnd.cpp:800:143: error: cannot call constructor 'GG::S

#1 Post by Nagilum »

Looks like compile on Linux fails since r5415:
[ 69%] Building CXX object client/human/CMakeFiles/freeorion.dir/__/__/UI/MapWnd.cpp.o
/root/freeorion/src/freeorion-build/UI/MapWnd.cpp: In constructor 'MapWnd::MapWnd()':
/root/freeorion/src/freeorion-build/UI/MapWnd.cpp:800:143: error: cannot call constructor 'GG::SubTexture::SubTexture' directly [-fpermissive]
/root/freeorion/src/freeorion-build/UI/MapWnd.cpp:800:143: error: for a function-style cast, remove the redundant '::SubTexture' [-fpermissive]
/root/freeorion/src/freeorion-build/UI/MapWnd.cpp: In member function 'void MapWnd::InitStarlaneRenderingBuffers()':
/root/freeorion/src/freeorion-build/UI/MapWnd.cpp:2309:25: warning: unused variable 'plen' [-Wunused-variable]
/root/freeorion/src/freeorion-build/UI/MapWnd.cpp: At global scope:
/root/freeorion/src/freeorion-build/UI/MapWnd.cpp:131:10: warning: '{anonymous}::temp_bool' defined but not used [-Wunused-variable]
make[2]: *** [client/human/CMakeFiles/freeorion.dir/__/__/UI/MapWnd.cpp.o] Error 1
make[1]: *** [client/human/CMakeFiles/freeorion.dir/all] Error 2
make: *** [all] Error 2

798
799 boost::shared_ptr<GG::Texture> wasted_ressource_texture = ClientUI::GetTexture(ClientUI::ArtDir() / "icons" /"wasted_resource.png", false);
800 GG::SubTexture wasted_ressource_subtexture = GG::SubTexture::SubTexture(wasted_ressource_texture, GG::X(0), GG::Y(0), GG::X(32), GG::Y(32));
801

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: UI/MapWnd.cpp:800:143: error: cannot call constructor 'G

#2 Post by Dilvish »

follow the hint the compiler gave you -- take out the extra "::SubTexture" (where it's doubled up twice in a row in line 800) and it will compile fine.

Someone with SVN write rights please make that change as well.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

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

Re: UI/MapWnd.cpp:800:143: error: cannot call constructor 'G

#3 Post by Nagilum »

Thanks, that worked! :)

Post Reply