libstdc++

Is libstdc++ support for std::unordered_map incomplete?

旧街凉风 提交于 2019-12-22 04:39:18
问题 Related to this question on CodeReview, I tried to use std::unordered_map with a custom allocator but apparently this does not work with gcc/clang and libstdc++. The error can be generated from initializing an empty hash map with a std::allocator #include <unordered_map> int main() { typedef std::allocator<std::pair<const int, int>> A; typedef std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, A> H; auto h = H{A()}; // ERROR, cannot find constructor H::H(const A&) } Live Example

How to get location of needed runtime libraries for msvc

只愿长相守 提交于 2019-12-20 07:26:45
问题 I have custom wrapper over CMake, which perform configuring, compilation, and creating distrib for various platforms (win32, SunOS and so on) and different compilers. I need to put into distrib all needed runtime libraries (libgcc_s.so, libstdc++.so for *nix like OS. msvcr90.dll, msvcp100.dll for win32). For example, gcc has mechanism, which allows to get full names of these libraries: # get location of libgcc_s of default compiler bash-3.2$ g++ -print-file-name=libgcc_s.so /usr/local/lib/gcc

Wrong GLIBCXX version when running a program that was compiled on the same machine

旧街凉风 提交于 2019-12-20 06:27:12
问题 How is it possible that a program that I compile, link and run on the same machine to have GLIBCXX version errors when I try to run it? Does anyone know? Here is the error I am getting: 0.01s$ build/test/gamgee_test build/test/gamgee_test: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by build/test/gamgee_test) build/test/gamgee_test: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by build/test/gamgee_test) full

Is there a way to set the elf NEEDED field at link time?

倾然丶 夕夏残阳落幕 提交于 2019-12-20 05:11:36
问题 Given a executable such that: >objdump -x someprog | grep c++ NEEDED libstdc++.so.6 I want to change the requirement to the full version (including the minor version and patch level): >objdump -x someprog | grep c++ NEEDED libstdc++.so.6.0.22 I know of two ways to do this: create a dummy library as per this question (Forcing or preventing use of a particular minor version of libstdc++) use patchelf >patchelf --add-needed libstdc++.so.6.0.22 someprog >objdump -x someprog | grep c++ NEEDED

Is there a way to set the elf NEEDED field at link time?

耗尽温柔 提交于 2019-12-20 05:11:34
问题 Given a executable such that: >objdump -x someprog | grep c++ NEEDED libstdc++.so.6 I want to change the requirement to the full version (including the minor version and patch level): >objdump -x someprog | grep c++ NEEDED libstdc++.so.6.0.22 I know of two ways to do this: create a dummy library as per this question (Forcing or preventing use of a particular minor version of libstdc++) use patchelf >patchelf --add-needed libstdc++.so.6.0.22 someprog >objdump -x someprog | grep c++ NEEDED

std::throw_with_nested expects polymorphic type in C++11?

北城余情 提交于 2019-12-19 12:51:50
问题 Why does this not compile (tried with Clang 3.4.2 and GCC versions 4.7.4, 4.8.3 and 4.9.1): #include <exception> struct E { E(int) {} }; int main() { std::throw_with_nested(E(42)); return 0; } Errors from GCC 4.9.1: In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.1/include/g++-v4/exception:163:0, from test.cpp:1: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.1/include/g++-v4/bits/nested_exception.h: In instantiation of 'static const std::nested_exception* std::__get_nested_helper<_Ex>::_S

/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found

北战南征 提交于 2019-12-19 08:12:29
问题 I am trying to run appium tests. However I get error saying what: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found I am using RedHat6.6. When I run: strings /usr/lib/libstdc++.so.6 | grep GLIBC I get this: GLIBC GLIBCXX_3.4 GLIBCXX_3.4.1 GLIBCXX_3.4.2 GLIBCXX_3.4.3 GLIBCXX_3.4.4 GLIBCXX_3.4.5 GLIBCXX_3.4.6 GLIBCXX_3.4.7 GLIBCXX_3.4.8 GLIBCXX_3.4.9 GLIBCXX_3.4.10 GLIBCXX_3.4.11 GLIBCXX_3.4.12 GLIBCXX_3.4.13 GLIBC_2.0 GLIBC_2.3 GLIBC_2.4 GLIBC_2.1 GLIBC_2.1.3 GLIBC_2.3.2 GLIBC_2.2

/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found

旧时模样 提交于 2019-12-19 08:12:18
问题 I am trying to run appium tests. However I get error saying what: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found I am using RedHat6.6. When I run: strings /usr/lib/libstdc++.so.6 | grep GLIBC I get this: GLIBC GLIBCXX_3.4 GLIBCXX_3.4.1 GLIBCXX_3.4.2 GLIBCXX_3.4.3 GLIBCXX_3.4.4 GLIBCXX_3.4.5 GLIBCXX_3.4.6 GLIBCXX_3.4.7 GLIBCXX_3.4.8 GLIBCXX_3.4.9 GLIBCXX_3.4.10 GLIBCXX_3.4.11 GLIBCXX_3.4.12 GLIBCXX_3.4.13 GLIBC_2.0 GLIBC_2.3 GLIBC_2.4 GLIBC_2.1 GLIBC_2.1.3 GLIBC_2.3.2 GLIBC_2.2

How to link with specific library ( g++; libstdc++.so.5 and libstdc++.so.6 )

╄→尐↘猪︶ㄣ 提交于 2019-12-19 03:49:17
问题 A simple question - is there any way to make the g++ linker to link with a specific libstdc++ library version? I didn't find anything useful in the man page of gcc / g++ , neither in other questions here. Here's the situation - my application uses a specific shared library, that's built with libstdc++.so.5 and I want to install and use it on RHEL5 . So, when I try to build the application on a RHEL5 machine, I got the warning: warning: libstdc++.so.5, needed by ..the_shared_library_.. may

Does std::vector::emplace() really offer the strong exception guarantee in the face of a throwing move constructor/assignment operator?

瘦欲@ 提交于 2019-12-18 23:46:58
问题 According to cppreference.com, std::vector::emplace() offers the strong exception guarantee unconditionally: If an exception is thrown (e.g. by the constructor), the container is left unmodified, as if this function was never called (strong exception guarantee). However, this doesn't seem to be the case in practice with GCC 7.1.1. The following program: #include <iostream> #include <vector> struct ugly { int i; ugly(int i) : i{i} { } ugly(const ugly& other) = default; ugly& operator=(ugly&&