cpp-driver fails with g++ 8.3.0
Closed this issue · 11 comments
I'm using Ubuntu 19.04, where the default g++ version is 8.3.0.
When trying to build a project depending on erlcass, it fails in it's cpp-compile-step:
.../deps/erlcass/_build/deps/cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/libc_allocator_with_realloc.h:68:40: error: 'void* realloc(void*, size_t)' moving an object of non-trivially copyable type 'struct std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >'; use 'new' and 'delete' instead [-Werror=class-memaccess]
return static_cast<pointer>(realloc(p, n * sizeof(value_type)));
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/8/bits/stl_algobase.h:64,
from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/string:40
The problem was easily fixed by installing g++-7 from apt.
Hello,
Can you please test the last master. Unfortunately I don't have a Ubuntu 19.04 to test.
Silviu
[PC-name]:~/workspace/erlcass (master)$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco
I cloned the project from master, and tried building (rebar3), but it failed.
I have attached the output here.
If I add CXX=g++-7 it works fine.
Can you try again ? Last master
Thanks. Please see now :)
Perfect :-)
Many thanks for the quick resolve-time as well!
You are welcome . Unfortunately all our production servers are on 16.04 and also travis ci seems doesn't support 19.04. So I can't add automatic build for this platform to check the integrity for every build.
Silviu
Ohh I did another commit to add that flags only on linux. seems osx doesn't support them and travis failed.
Can you check again ?
Sure.
Works fine :-)
Thanks,
All other platforms built ok as well.
Silviu