leycec / raiagent

Third-party Gentoo overlay. Ride the Lagrangian point between awesomeness and volatile compounds.
31 stars 14 forks source link

games-roguelike/cataclysm-dda-0.9c-r4 fails compilation #59

Closed mothringer closed 7 years ago

mothringer commented 7 years ago

The above referenced ebuild fails compilation for me with the error below.

src/crafting.cpp: In member function ‘void player::complete_disassemble()’: src/crafting.cpp:2045:47: error: ‘pow’ is not a member of ‘std’ float component_success_chance = std::min(std::pow(0.8f, dis_item.damage), 1.0); ^ src/crafting.cpp:2045:47: note: suggested alternative: In file included from /usr/include/features.h:368:0, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/x86_64-pc-linux-gnu/bits/os_defines.h:39, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/x86_64-pc-linux-gnu/bits/c++config.h:482, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/string:38, from src/crafting.cpp:1: /usr/include/bits/mathcalls.h:153:1: note: ‘pow’ __MATHCALL_VEC (pow,, (Mdouble x, Mdouble y)); ^ g++ -DRELEASE -DLOCALIZE -DPREFIX="/usr" -DUSE_HOME_DIR -O3 -pipe -march=native -Wall -Wextra --std=c++11 -MMD -m64 -DLUA -D_GNU_SOURCE -I/usr/include/ncursesw -c src/posix_time.cpp -o obj/posix_time.o g++ -DRELEASE -DLOCALIZE -DPREFIX="/usr" -DUSE_HOME_DIR -O3 -pipe -march=native -Wall -Wextra --std=c++11 -MMD -m64 -DLUA -D_GNU_SOURCE -I/usr/include/ncursesw -c src/skill.cpp -o obj/skill.o make: [Makefile:448: obj/crafting.o] Error 1 make: Waiting for unfinished jobs.... src/player.cpp: In member function ‘void player::pick_style()’: src/player.cpp:9791:10: warning: ‘template class std::auto_ptr’ is deprecated [-Wdeprecated-declarations] std::auto_ptr ma_style_info(new ma_style_callback()); ^ In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/memory:81:0, from src/messages.h:6, from src/effect.h:6, from src/creature.h:9, from src/character.h:4, from src/player.h:4, from src/player.cpp:1: /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/bits/unique_ptr.h:49:28: note: declared here template class auto_ptr;

leycec commented 7 years ago

Ugh. Thanks for the detailed report, mothringer. Excellent username as well. Because we could all use a little more Mothra.

This sadly appears to be an upstream issue. The fix is happily trivial: the src/crafting.cpp file needs to be prepended by the line #include <cmath>, at which point compilation should succeed. Completely untested. May destroy your life.

Would you mind filing an upstream issue at the C:DDA issue tracker, ideally including the same error output and this proposed solution? If not, that's cool. Time's a bit scarce on my end, however.

So it goes. ⌛️

mothringer commented 7 years ago

I opened an issue on the upstream tracker.

leycec commented 7 years ago

Cheers. Under the safe assumption that this is an upstream issue, this is (hopefully) closable on our end. Feel free to reopen this if upstream says otherwise.

Thanks again for flying the post-apocalyptic airways with raiagent.