# Unable to compile

**URL:** <https://discourse.cataclysmdda.org/t/unable-to-compile/11965>\
**Category:** The Garage\
**Created:** [May 31, 2016, 10:04pm UTC](https://discourse.cataclysmdda.org/t/unable-to-compile/11965 "2016-05-31T22:04:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KlargDeThaym](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/klargdethaym/32/1250_2.png) [@KlargDeThaym](https://discourse.cataclysmdda.org/u/KlargDeThaym)\
**Post date:** [May 31, 2016, 10:04pm UTC](https://discourse.cataclysmdda.org/t/unable-to-compile/11965/1 "2016-05-31T22:04:28Z")

</div>

I’m trying to compile experimental version, downloaded from Github, and I’m unable to do that. That’s what I’m getting:

`g++ -DGIT_VERSION -DLOCALIZE -ffast-math -Og -Wall -Wextra -g -D_GLIBCXX_DEBUG -std=c++11 -MMD -c src/mondeath.cpp -o obj/mondeath.o
src/mondeath.cpp: In function 'void mdeath::normal(monster*)':
src/mondeath.cpp:82:94: error: no matching function for call to 'min(float, double)'
             const int number_of_gibs = std::min( floor( corpseDamage ) - 1, 1 + max_hp / 5.0 ) + ( is_big_beast ? rng( 1, 6 ) : 0 );
                                                                                              ^
In file included from /usr/include/c++/6.1.1/bits/char_traits.h:39:0,
                 from /usr/include/c++/6.1.1/string:40,
                 from src/json.h:6,
                 from src/pldata.h:4,
                 from src/creature.h:4,
                 from src/monster.h:4,
                 from src/mondeath.cpp:2:
/usr/include/c++/6.1.1/bits/stl_algobase.h:195:5: note: candidate: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp&__ b)
     ^~~
/usr/include/c++/6.1.1/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed:
src/mondeath.cpp:82:94: note: deduced conflicting types for parameter 'const _Tp' ('float' and 'double')
             const int number_of_gibs = std::min( floor( corpseDamage ) - 1, 1 + max_hp / 5.0 ) + ( is_big_beast ? rng( 1, 6 ) : 0 );
                                                                                              ^
In file included from /usr/include/c++/6.1.1/bits/char_traits.h:39:0,
                 from /usr/include/c++/6.1.1/string:40,
                 from src/json.h:6,
                 from src/pldata.h:4,
                 from src/creature.h:4,
                 from src/monster.h:4,
                 from src/mondeath.cpp:2:
/usr/include/c++/6.1.1/bits/stl_algobase.h:243:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp&__ b, _Compare __comp)
     ^~~
/usr/include/c++/6.1.1/bits/stl_algobase.h:243:5: note: template argument deduction/substitution failed:
src/mondeath.cpp:82:94: note: deduced conflicting types for parameter 'const _Tp' ('float' and 'double')
             const int number_of_gibs = std::min( floor( corpseDamage ) - 1, 1 + max_hp / 5.0 ) + ( is_big_beast ? rng( 1, 6 ) : 0 );
                                                                                              ^
In file included from /usr/include/c++/6.1.1/algorithm:62:0,
                 from src/damage.h:10,
                 from src/mtype.h:10,
                 from src/mondeath.cpp:16:
/usr/include/c++/6.1.1/bits/stl_algo.h:3454:5: note: candidate: template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)
     min(initializer_list<_Tp> __l)
     ^~~
/usr/include/c++/6.1.1/bits/stl_algo.h:3454:5: note: template argument deduction/substitution failed:
src/mondeath.cpp:82:94: note: mismatched types 'std::initializer_list<_Tp>' and 'float'
             const int number_of_gibs = std::min( floor( corpseDamage ) - 1, 1 + max_hp / 5.0 ) + ( is_big_beast ? rng( 1, 6 ) : 0 );
                                                                                              ^
In file included from /usr/include/c++/6.1.1/algorithm:62:0,
                 from src/damage.h:10,
                 from src/mtype.h:10,
                 from src/mondeath.cpp:16:
/usr/include/c++/6.1.1/bits/stl_algo.h:3460:5: note: candidate: template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)
     min(initializer_list<_Tp> __l, _Compare__ comp)
     ^~~
/usr/include/c++/6.1.1/bits/stl_algo.h:3460:5: note: template argument deduction/substitution failed:
src/mondeath.cpp:82:94: note: mismatched types 'std::initializer_list<_Tp>' and 'float'
             const int number_of_gibs = std::min( floor( corpseDamage ) - 1, 1 + max_hp / 5.0 ) + ( is_big_beast ? rng( 1, 6 ) : 0 );
                                                                                              ^
Makefile:623: recipe for target 'obj/mondeath.o' failed
make: *** [obj/mondeath.o] Error 1
`

Using Antergos Linux (Arch derivative). I’d be very grateful for any help.

---

<div class="post-metadata">

**Author:** ![MKuchera](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@MKuchera](https://discourse.cataclysmdda.org/u/MKuchera)\
**Post date:** [June 1, 2016, 12:32am UTC](https://discourse.cataclysmdda.org/t/unable-to-compile/11965/2 "2016-06-01T00:32:39Z")

</div>

In src/mondeath.cpp line 82, try changing `1 + max_hp / 5.0 )` to `float(1 + max_hp / 5.0 ))`.

Not sure if there need to be changes elsewhere, but it seems to work for me.

---

<div class="post-metadata">

**Author:** ![KlargDeThaym](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/klargdethaym/32/1250_2.png) [@KlargDeThaym](https://discourse.cataclysmdda.org/u/KlargDeThaym)\
**Post date:** [June 1, 2016, 6:14am UTC](https://discourse.cataclysmdda.org/t/unable-to-compile/11965/3 "2016-06-01T06:14:56Z")

</div>

[quote=“MKuchera, post:2, topic:11965”]In src/mondeath.cpp line 82, try changing `1 + max_hp / 5.0 )` to `float(1 + max_hp / 5.0 ))`.

Not sure if there need to be changes elsewhere, but it seems to work for me.[/quote]

Sadly, that didn’t help, still getting the same errors.

Edit: Disregard all the above, I’m blind and missed the “float” part. Your advice worked, thanks a lot!
