libstdc++

C++11 random number distributions are not consistent across platforms — what alternatives are there?

我与影子孤独终老i 提交于 2019-11-26 21:16:05
问题 I'm looking for a set of portable distributions for the standard C++11 engines like `std::mt19937' (see http://en.cppreference.com/w/cpp/numeric/random). The engine implementations perform consistently (i.e. same sequence generated on different platforms – tested with Clang and MSVC), but the distributions seem to be implemented differently on the different platforms. So, even though the engines produce the same sequence, it seems that a distribution (for example, std::normal_distribution

Where can I get a copy of the file libstdc++.so.6.0.15 [closed]

荒凉一梦 提交于 2019-11-26 20:48:51
I am trying to fix my problem "GLIBCXX_3.4.15" not found, which is fairly well documented to fix. But it requires getting the file "libstdc++.so.6.0.15" from somewhere. Most of the solutions tell me to get it from the location that I compiled my c++ library from. However, I did not compile it, it came with my Ubuntu installation, and when I do "locate" for that file it is not found. So, I would like to just download it from somewhere, but I can't find it on the web anywhere. I have tried to look in the svn repo: svn://gcc.gnu.org/svn/gcc, but was not able to find it (its huge!) Any help much

Why can't I use <experimental/filesystem> with g++ 4.9.2?

寵の児 提交于 2019-11-26 16:51:40
问题 I am trying to use filesystem. I have -std=c++11 -std=c++1y in my CMakeLists.txt . GCC version is 4.9.2 . However, I have got an error: /home/loom/MyProject/src/main.cpp:5:35: fatal error: experimental/filesystem: No such file or directory #include <experimental/filesystem> ^ compilation terminated. What is the right way to use std::experimental::filesystem ? 回答1: If we look at the libstdc++ status we see that they do have support for the File System TS: Paper | Title | Status ........ N4100

Using libstdc++ compiled libraries with clang++ -stdlib=libc++

孤者浪人 提交于 2019-11-26 15:13:59
问题 I am working in C++ under Mac OS X (10.8.2) and I recently came up with the need of using C++11 features, which are available through the clang++ compiler using the libc++ stdlib. However, I also need to use some legacy library compiled and linked against libstdc++ (coming from MacPorts). In doing so, I got linking errors, since the headers of the legacy libraries using, e.g., std::string , required to be resolved against the std::__1::basic_string (i.e., the libc++ implementation of std:

C++ project compiled with modern compiler, but linked against outdated libstdc++

☆樱花仙子☆ 提交于 2019-11-26 11:37:27
问题 Consider the situation when a C++ project is built and shipped within a Centos 7 virtual machine or container. Default gcc for Centos 7 is 4.8 . In order to allow developers to use modern C++, the more recent version of gcc (for example, 6.3 ) is installed into Centos 7 which runs as a CI server. This provides -std=c++14 support. [builder@f7279ae9f33f build (master %)]$ /usr/bin/c++ -v 2>&1 | grep version gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) [builder@f7279ae9f33f build (master

Why does passing object reference arguments to thread function fails to compile?

♀尐吖头ヾ 提交于 2019-11-26 11:24:31
I've come to a problem using the new c++11 std::thread interface. I can't figure out how to pass a reference to a std::ostream to the function that the thread will execute. Here's an example with passing an integer(compile and work as expected under gcc 4.6) : void foo(int &i) { /** do something with i **/ std::cout << i << std::endl; } int k = 10; std::thread t(foo, k); But when I try passing an ostream it does not compile : void foo(std::ostream &os) { /** do something with os **/ os << "This should be printed to os" << std::endl; } std::thread t(foo, std::cout); Is there a way to do just

Linking g++ 4.8 to libstdc++

a 夏天 提交于 2019-11-26 11:23:29
问题 I downloaded and built gcc 4.8.1 on my desktop, running 64-bit Ubuntu 12.04. I built it out of source, like the docs recommend, and with the commands ../../gcc-4.8.1/configure --prefix=$HOME --program-suffix=-4.8 make make -k check make install It seemed to pass all the tests, and I installed everything into my home directory w/ the suffix -4.8 to distinguish from the system gcc, which is version 4.6.3. Unfortunately when I compile c++ programs using g++-4.8 it links to the system libc and

/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15&#39; not found

ぃ、小莉子 提交于 2019-11-26 11:04:56
How can I get GLIBCXX_3.4.15 in Ubuntu? I can't run some programs that I'm compiling. When I do: strings /usr/lib/libstdc++.so.6 | grep GLIBC I get: 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 GLIBCXX_3.4.14 GLIBC_2.2.5 GLIBC_2.3 GLIBC_2.4 GLIBC_2.3.4 GLIBC_2.3.2 GLIBCXX_FORCE_NEW GLIBCXX_DEBUG_MESSAGE_LENGTH Thanks for any help! I'm compiling gcc 4.6 from source, and apparently sudo make install didn't catch this one. I dug around and found

Linking libstdc++ statically: any gotchas?

最后都变了- 提交于 2019-11-26 08:43:00
问题 I need to deploy a C++ application built on Ubuntu 12.10 with GCC 4.7\'s libstdc++ to systems running Ubuntu 10.04, which comes with a considerably older version of libstdc++. Currently, I\'m compiling with -static-libstdc++ -static-libgcc , as suggested by this blog post: Linking libstdc++ statically. The author warns against using any dynamically-loaded C++ code when compiling libstdc++ statically, which is something I haven\'t yet checked. Still, everything seems to be going smoothly so

Using std::array with initialization lists

穿精又带淫゛_ 提交于 2019-11-26 08:21:50
问题 Unless I am mistaken, it should be possible to create a std:array in these ways: std::array<std::string, 2> strings = { \"a\", \"b\" }; std::array<std::string, 2> strings({ \"a\", \"b\" }); And yet, using GCC 4.6.1 I am unable to get any of these to work. The compiler simply says: expected primary-expression before \',\' token and yet initialization lists work just fine with std::vector. So which is it? Am I mistaken to think std::array should accept initialization lists, or has the GNU