I successfully built a 64-bit xmrigCC binary, and now I am trying to build a 32-bit one. I added -m32
to the flags (in cmake/flags.cmake
) but I ran into an error while building. It seems to be related to the rapidjson library, but I have no C++ knowledge so I can't fix it myself.
[ 96%] Building CXX object CMakeFiles/xmrigMiner.dir/src/cc/ClientStatus.cpp.o
In file included from /root/xmrigCC/src/cc/ClientStatus.h:30:0,
from /root/xmrigCC/src/cc/ClientStatus.cpp:32:
/root/xmrigCC/src/3rdparty/rapidjson/document.h: In instantiation of ‘typename rapidjson::internal::DisableIf<typename rapidjson::internal::RemoveSfinaeTag<rapidjson::internal::SfinaeTag& (*)(rapidjson::internal::OrExpr<rapidjson::internal::IsPointer<T>, rapidjson::internal::IsGenericValue<T> >)>::Type, typename rapidjson::internal::RemoveSfinaeTag<rapidjson::internal::SfinaeTag& (*)(rapidjson::GenericValue<Encoding, Allocator>&)>::Type>::Type rapidjson::GenericValue<Encoding, Allocator>::AddMember(rapidjson::GenericValue<Encoding, Allocator>&, T, Allocator&) [with T = long int; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; typename rapidjson::internal::DisableIf<typename rapidjson::internal::RemoveSfinaeTag<rapidjson::internal::SfinaeTag& (*)(rapidjson::internal::OrExpr<rapidjson::internal::IsPointer<T>, rapidjson::internal::IsGenericValue<T> >)>::Type, typename rapidjson::internal::RemoveSfinaeTag<rapidjson::internal::SfinaeTag& (*)(rapidjson::GenericValue<Encoding, Allocator>&)>::Type>::Type = rapidjson::GenericValue<rapidjson::UTF8<> >&]’:
/root/xmrigCC/src/3rdparty/rapidjson/document.h:1330:25: required from ‘typename rapidjson::internal::DisableIf<typename rapidjson::internal::RemoveSfinaeTag<rapidjson::internal::SfinaeTag& (*)(rapidjson::internal::OrExpr<rapidjson::internal::IsPointer<T>, rapidjson::internal::IsGenericValue<T> >)>::Type, typename rapidjson::internal::RemoveSfinaeTag<rapidjson::internal::SfinaeTag& (*)(rapidjson::GenericValue<Encoding, Allocator>&)>::Type>::Type rapidjson::GenericValue<Encoding, Allocator>::AddMember(rapidjson::GenericValue<Encoding, Allocator>::StringRefType, T, Allocator&) [with T = long int; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; typename rapidjson::internal::DisableIf<typename rapidjson::internal::RemoveSfinaeTag<rapidjson::internal::SfinaeTag& (*)(rapidjson::internal::OrExpr<rapidjson::internal::IsPointer<T>, rapidjson::internal::IsGenericValue<T> >)>::Type, typename rapidjson::internal::RemoveSfinaeTag<rapidjson::internal::SfinaeTag& (*)(rapidjson::GenericValue<Encoding, Allocator>&)>::Type>::Type = rapidjson::GenericValue<rapidjson::UTF8<> >&; rapidjson::GenericValue<Encoding, Allocator>::StringRefType = rapidjson::GenericStringRef<char>; typename Encoding::Ch = char]’
/root/xmrigCC/src/cc/ClientStatus.cpp:468:79: required from here
/root/xmrigCC/src/3rdparty/rapidjson/document.h:1259:29: error: call of overloaded ‘GenericValue(long int&)’ is ambiguous
GenericValue v(value);
^
/root/xmrigCC/src/3rdparty/rapidjson/document.h:673:14: note: candidate: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(double) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]
explicit GenericValue(double d) RAPIDJSON_NOEXCEPT : data_() { data_.n.d = d; data_.f.flags = kNumberDoubleFlag; }
^~~~~~~~~~~~
/root/xmrigCC/src/3rdparty/rapidjson/document.h:661:14: note: candidate: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(uint64_t) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; uint64_t = long long unsigned int]
explicit GenericValue(uint64_t u64) RAPIDJSON_NOEXCEPT : data_() {
^~~~~~~~~~~~
/root/xmrigCC/src/3rdparty/rapidjson/document.h:646:14: note: candidate: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(int64_t) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; int64_t = long long int]
explicit GenericValue(int64_t i64) RAPIDJSON_NOEXCEPT : data_() {
^~~~~~~~~~~~
/root/xmrigCC/src/3rdparty/rapidjson/document.h:640:14: note: candidate: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(unsigned int) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]
explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_() {
^~~~~~~~~~~~
/root/xmrigCC/src/3rdparty/rapidjson/document.h:634:14: note: candidate: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(int) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]
explicit GenericValue(int i) RAPIDJSON_NOEXCEPT : data_() {
^~~~~~~~~~~~
/root/xmrigCC/src/3rdparty/rapidjson/document.h:573:5: note: candidate: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(const rapidjson::GenericValue<Encoding, Allocator>&) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]
GenericValue(const GenericValue& rhs);
^~~~~~~~~~~~
/root/xmrigCC/src/3rdparty/rapidjson/document.h:566:5: note: candidate: rapidjson::GenericValue<Encoding, Allocator>::GenericValue(rapidjson::GenericValue<Encoding, Allocator>&&) [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>]
GenericValue(GenericValue&& rhs) RAPIDJSON_NOEXCEPT : data_(rhs.data_) {
^~~~~~~~~~~~
CMakeFiles/xmrigMiner.dir/build.make:1022: recipe for target 'CMakeFiles/xmrigMiner.dir/src/cc/ClientStatus.cpp.o' failed
make[2]: *** [CMakeFiles/xmrigMiner.dir/src/cc/ClientStatus.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/xmrigMiner.dir/all' failed
make[1]: *** [CMakeFiles/xmrigMiner.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
[root@buildserver build]#
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-strict-aliasing -m32")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-exceptions -fno-rtti -m32")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -s -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -m32")