mapsme / omim

🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android
Apache License 2.0
4.57k stars 1.15k forks source link

Build failure on Ubuntu Xenial because of std::basic_string noexcept #4417

Open giraldeau opened 8 years ago

giraldeau commented 8 years ago

While compiling omim with Ubuntu Xenial 16.04, I got this error:

clang++ -c -pipe -stdlib=libc++ -fdata-sections -ffunction-sections -O3 -ffast-math -g -fPIC -std=c++11 -Wall -W -Wno-sign-compare -Wno-strict-aliasing -Wno-unused-parameter -Wno-unused-local-typedef -Wno-sign-conversion -Werror=return-type -D_REENTRANT -DRELEASE -D_RELEASE -DNDEBUG -DQT_NO_DEBUG -I/home/francis/gitsrc/omim/indexer -I. -I/home/francis/gitsrc/omim/3party/protobuf/src -I/home/francis/gitsrc/omim -I/home/francis/gitsrc/omim/3party/boost -I/home/francis/gitsrc/omim/3party/glm -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-clang-libc++ -o ../out/release/tmp/indexer/classificator_loader.o /home/francis/gitsrc/omim/indexer/classificator_loader.cpp
2 errors generated.
Makefile:1395: recipe for target '../out/release/tmp/indexer/altitude_loader.o' failed
make[1]: *** [../out/release/tmp/indexer/altitude_loader.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /home/francis/gitsrc/omim/indexer/classificator.cpp:1:
In file included from /home/francis/gitsrc/omim/indexer/classificator.hpp:3:
In file included from /home/francis/gitsrc/omim/indexer/drawing_rule_def.hpp:3:
In file included from /home/francis/gitsrc/omim/base/buffer_vector.hpp:2:
In file included from /home/francis/gitsrc/omim/base/assert.hpp:3:
In file included from /home/francis/gitsrc/omim/base/internal/message.hpp:10:
In file included from /home/francis/gitsrc/omim/std/sstream.hpp:7:
In file included from /usr/include/c++/v1/sstream:174:
In file included from /usr/include/c++/v1/ostream:138:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
/usr/include/c++/v1/string:1938:44: error: 'basic_string<_CharT, _Traits, _Allocator>' is missing
      exception specification 'noexcept(is_nothrow_copy_constructible<allocator_type>::value)'
basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)
                                           ^
/usr/include/c++/v1/string:1326:40: note: previous declaration is here
    _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)

The explaination of the error can be found here. As a workaround, I'm using the spec linux-clang instead of linux-clang-libc++:

SPEC=linux-clang ./tools/unix/build_omim.sh

Out of curiosity: why using libc++ instead of libstdc++?

roiamiel1 commented 7 years ago

Hi, I have the same problem... did you found a solution?