Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile rttr on a Ubuntu 22.04 machine #343

Open
IshaanDesai opened this issue Sep 1, 2022 · 2 comments
Open

Cannot compile rttr on a Ubuntu 22.04 machine #343

IshaanDesai opened this issue Sep 1, 2022 · 2 comments

Comments

@IshaanDesai
Copy link

Hello,

I am struggling to compile rttr on a Ubuntu 22.04 machine. I am using the master branch and the commit: 7edbd58. The error I get is:

~/rttr/3rd_party/rapidjson-1.1.0/rapidjson/document.h:1953:24: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ 
with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
 1953 |             std::memcpy(e, values, count * sizeof(GenericValue));
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~´

The CMake configuration is:

-- The CXX compiler identification is GNU 11.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Project version: 0.9.7
-- Architecture: x64
-- Enabled: use of RTTI
-- Performing Test HAS_NO_EXCEPT_TYPE_SIGNATURE_SUPPORT
-- Performing Test HAS_NO_EXCEPT_TYPE_SIGNATURE_SUPPORT - Success
-- Performing Test HAS_STL_NO_EXCEPT_TYPE_SIGNATURE_SUPPORT
-- Performing Test HAS_STL_NO_EXCEPT_TYPE_SIGNATURE_SUPPORT - Success
-- Performing Test HAS_CXX_CONSTEXPR
-- Performing Test HAS_CXX_CONSTEXPR - Success
-- Performing Test HAS_PARTIAL_SPECIALIZATION_FOR_ARRAYS
-- Performing Test HAS_PARTIAL_SPECIALIZATION_FOR_ARRAYS - Success
-- using C++: 17

I passed "-sd=c++11" as CMAKE_CXX_FLAGS but that led to the compiler being usable right in the CMake phase. How can I resolve the above error?

@LightSun
Copy link

same as me . wait response

@carme-hp
Copy link

carme-hp commented May 9, 2023

I manage to build rttr in Ubuntu 22.04 only after modifying two of the header files:
In file I changed the following:

...
#  else // CATCH_CONFIG_POSIX_SIGNALS is defined

#include <signal.h>

#undef SIGSTKSZ
#define SIGSTKSZ 32768

namespace Catch {
...

and in file

...
if (count) {
             GenericValue* e = static_cast<GenericValue*>(allocator.Malloc(count * sizeof(GenericValue)));
             SetElementsPointer(e);
            //std::memcpy(e, values, count * sizeof(GenericValue));
            e = values;
         }
  ...
 if (count) {
             Member* m = static_cast<Member*>(allocator.Malloc(count * sizeof(Member)));
             SetMembersPointer(m);
            //std::memcpy(m, members, count * sizeof(Member));
            m = members;
}
...         

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants