I wanted to try this out on Ubuntu 1904 compiled with cmake. I had to do a little change:
My c++ is a bit rusty, but casting them explicitly seems to do the job, but I get more of this error after I fixed them
Code: Select all
ox:~/Downloads/Banksia/build$ make
[ 4%] Building CXX object src/game/CMakeFiles/game.dir/engineprofile.cpp.o
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp: In member function ‘std::__cxx11::string banksia::Profile::toString(bool) const’:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:48:62: error: no matching function for call to ‘max(long long unsigned int, const uint64_t&)’
auto cpu = double(cpuTotal) * 100.0 / std::max(1ULL, cpuTime);
^
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/istream:38,
from /usr/include/c++/8/sstream:38,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:26:
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
max(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:48:62: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘uint64_t’ {aka ‘long unsigned int’})
auto cpu = double(cpuTotal) * 100.0 / std::max(1ULL, cpuTime);
^
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/istream:38,
from /usr/include/c++/8/sstream:38,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:26:
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:48:62: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘uint64_t’ {aka ‘long unsigned int’})
auto cpu = double(cpuTotal) * 100.0 / std::max(1ULL, cpuTime);
^
In file included from /usr/include/c++/8/algorithm:62,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:27:
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: candidate: ‘template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)’
max(initializer_list<_Tp> __l)
^~~
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:48:62: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
auto cpu = double(cpuTotal) * 100.0 / std::max(1ULL, cpuTime);
^
In file included from /usr/include/c++/8/algorithm:62,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:27:
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)’
max(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:48:62: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
auto cpu = double(cpuTotal) * 100.0 / std::max(1ULL, cpuTime);
^
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:49:83: error: no matching function for call to ‘max(long long unsigned int, const uint64_t&)’
auto thinking = double(cpuThinkingTotal) * 100.0 / std::max(1ULL, cpuThinkingTime);
^
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/istream:38,
from /usr/include/c++/8/sstream:38,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:26:
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
max(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:49:83: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘uint64_t’ {aka ‘long unsigned int’})
auto thinking = double(cpuThinkingTotal) * 100.0 / std::max(1ULL, cpuThinkingTime);
^
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/istream:38,
from /usr/include/c++/8/sstream:38,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:26:
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:49:83: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘uint64_t’ {aka ‘long unsigned int’})
auto thinking = double(cpuThinkingTotal) * 100.0 / std::max(1ULL, cpuThinkingTime);
^
In file included from /usr/include/c++/8/algorithm:62,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:27:
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: candidate: ‘template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)’
max(initializer_list<_Tp> __l)
^~~
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:49:83: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
auto thinking = double(cpuThinkingTotal) * 100.0 / std::max(1ULL, cpuThinkingTime);
^
In file included from /usr/include/c++/8/algorithm:62,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:27:
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)’
max(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:49:83: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
auto thinking = double(cpuThinkingTotal) * 100.0 / std::max(1ULL, cpuThinkingTime);
^
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:50:51: error: no matching function for call to ‘max(long long unsigned int, const uint64_t&)’
auto mem = int(memTotal / (std::max(1ULL, memCall) * 1024 * 1024));
^
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/istream:38,
from /usr/include/c++/8/sstream:38,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:26:
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
max(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:50:51: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘uint64_t’ {aka ‘long unsigned int’})
auto mem = int(memTotal / (std::max(1ULL, memCall) * 1024 * 1024));
^
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/istream:38,
from /usr/include/c++/8/sstream:38,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:26:
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:50:51: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘uint64_t’ {aka ‘long unsigned int’})
auto mem = int(memTotal / (std::max(1ULL, memCall) * 1024 * 1024));
^
In file included from /usr/include/c++/8/algorithm:62,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:27:
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: candidate: ‘template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)’
max(initializer_list<_Tp> __l)
^~~
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:50:51: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
auto mem = int(memTotal / (std::max(1ULL, memCall) * 1024 * 1024));
^
In file included from /usr/include/c++/8/algorithm:62,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:27:
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)’
max(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:50:51: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
auto mem = int(memTotal / (std::max(1ULL, memCall) * 1024 * 1024));
^
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:52:60: error: no matching function for call to ‘max(long long unsigned int, const uint64_t&)’
auto threads = int(threadTotal / std::max(1ULL, threadCall));
^
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/istream:38,
from /usr/include/c++/8/sstream:38,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:26:
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
max(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:52:60: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘uint64_t’ {aka ‘long unsigned int’})
auto threads = int(threadTotal / std::max(1ULL, threadCall));
^
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/istream:38,
from /usr/include/c++/8/sstream:38,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:26:
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: candidate: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:52:60: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘uint64_t’ {aka ‘long unsigned int’})
auto threads = int(threadTotal / std::max(1ULL, threadCall));
^
In file included from /usr/include/c++/8/algorithm:62,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:27:
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: candidate: ‘template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)’
max(initializer_list<_Tp> __l)
^~~
/usr/include/c++/8/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:52:60: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
auto threads = int(threadTotal / std::max(1ULL, threadCall));
^
In file included from /usr/include/c++/8/algorithm:62,
from /home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:27:
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)’
max(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed:
/home/tobias/Downloads/Banksia/src/game/engineprofile.cpp:52:60: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long unsigned int’
auto threads = int(threadTotal / std::max(1ULL, threadCall));
^
make[2]: *** [src/game/CMakeFiles/game.dir/build.make:102: src/game/CMakeFiles/game.dir/engineprofile.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:481: src/game/CMakeFiles/game.dir/all] Error 2
make: *** [Makefile:84: all] Error 2