libstdc++

Discrepancy between istream's operator>> (double& val) between libc++ and libstdc++

你离开我真会死。 提交于 2019-11-28 12:11:40
With my recent upgrade to Mac OS X 10.9 the default standard C++ library changed from libstdc++ to libc++. Since then I observe unexpected behaviour of the stringstream operator>>(double) documented in the code example below. In summary the libc++ seems to have problems with extracting double values from stringstreams when the double value is followed by a letter. I already checked the standard (2003) but I can't find any specific information if extraction should work in this case or not. So I would be grateful for any input whether this is a bug in libc++ or libstdc++. #include <sstream>

GDB error message (GCC 4.7) (from macports)

社会主义新天地 提交于 2019-11-28 11:48:17
问题 I have this kind of message when I start gdb : $ gdb a.out GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-apple

Using memory sanitizer with libstdc++

空扰寡人 提交于 2019-11-28 08:56:53
I wish to use the -fsanitize=memory flag in clang to analyse a program like the following: #include <string> #include <iostream> #include <fstream> using namespace std; void writeToFile(){ ofstream o; o.open("dum"); o<<"test"<<endl; //The error is here. //It does not matter if the file is opened this way, //or with o("dum"); o.close(); } int main(){ writeToFile(); } As far as I know, this program is correct, but when I use clang++ san.cpp -fsanitize=memory It fails (at runtime) with: UMR in __interceptor_write at offset 0 inside [0x64800000e000, +5) ==9685== WARNING: MemorySanitizer: use-of

Android SDK - aapt error : libstdc++.so.6 cannot open shared object file

泪湿孤枕 提交于 2019-11-28 04:40:21
I was creating a new project out of nothing, for testing purpose, leaving all parameter to default (I didn't made any code change), on a new ADT installation (Ubuntu Gnome 14.04 LTS, x86_64 CPU), but I have the following error in the Eclipse Console : [2014-06-11 09:03:10 - Kronos] /home/erwan/Applications/ADT/adt-bundle-linux-x86_64-20140321/sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory Here is what I already tried: -> I tried to (re)install ia32-libs, libstdc++ and libstdc++6 via Ubuntu software

Handling “dyld: lazy symbol binding failed: Symbol not found” error when nm does not find symbol

帅比萌擦擦* 提交于 2019-11-28 03:51:10
问题 I have a fat (32- and 64-bit) Intel binary called myBinary that fails to run on another workstation running Mac OS X 10.8.2: $ myBinary dyld: lazy symbol binding failed: Symbol not found: __ZNSt8__detail15_List_node_base7_M_hookEPS0_ Referenced from: /usr/local/bin/myBinary Expected in: /usr/lib/libstdc++.6.dylib dyld: Symbol not found: __ZNSt8__detail15_List_node_base7_M_hookEPS0_ Referenced from: /usr/local/bin/myBinary Expected in: /usr/lib/libstdc++.6.dylib Trace/BPT trap: 5 I compiled it

Why does g++ still require -latomic

落爺英雄遲暮 提交于 2019-11-28 02:52:29
问题 In 29.5 Atomic types of the C++ Standard November 2014 working draft it states: There is a generic class template atomic. The type of the template argument T shall be trivially copyable (3.9). [ Note: Type arguments that are not also statically initializable may be difficult to use. —end note ] So - as far as I can tell - this: #include <atomic> struct Message { unsigned long int a; unsigned long int b; }; std::atomic<Message> sharedState; int main() { Message tmp{1,2}; sharedState.store(tmp)

Forcing or preventing use of a particular minor version of libstdc++

不想你离开。 提交于 2019-11-28 01:04:10
In order to make use of C++11 and c++14 features I have an application compiled using a newer version of gcc (4.9.1) and thus an newer version of libstdc++. The application consists of many small programs so I am linking with libstdc++ as a shared library rather than a static one (i.e. I don't wish to use -static-libstdc++) I wish to ship the new version of libstdc++ with the application under /opt//lib64 (note: that this is specifically allowed under an exception to the GPL) The new version of libstdc++.so differs with the version on the target platform only by minor version. libstdc++ is

How to build an application that requires both libstdc++.so.5 and libstdc++.so.6?

送分小仙女□ 提交于 2019-11-28 00:25:11
问题 I want to preface this with the important notice that I am not a C/C++ programmer , and know very little about how linkage of libraries works in C. Our code uses libstdc++.so.6 (gcc 3.4, i think). We have third-party precompiled (closed source) libraries that use libstdc++.so.5 (gcc 2.something or 3.2, i think). This is on linux. We have both a .a and .so version of the third party lib. Is it possible to build our app with the 3rd party libs? How? Is it possible to build/run our app without

Valgrind Unrecognised instruction

久未见 提交于 2019-11-27 23:27:14
I have the following code: #include <iostream> #include <random> int main() { std::mt19937_64 rng(std::random_device{}()); std::cout << std::uniform_int_distribution<>(0, 100)(rng) << '\n'; } I try to profile it using valgrind , but it says: vex amd64->IR: unhandled instruction bytes: 0xF 0xC7 0xF0 0x89 0x6 0xF 0x42 0xC1 vex amd64->IR: REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0 vex amd64->IR: VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F vex amd64->IR: PFX.66=0 PFX.F2=0 PFX.F3=0 ==2092== valgrind: Unrecognised instruction at address 0x4cdc1b5. ==2092== at 0x4CDC1B5:std::(anonymous namespace)::__x86_rdrand()

libstdc++ GLIBCXX version errors

℡╲_俬逩灬. 提交于 2019-11-27 23:10:40
when I compile a c++ program in my computer using g++ and transfer the executable to run it on my university server, I get ./main: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./main) ./main: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./main) ./main: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./main) The program runs well on my computer, and I don't have privileges to install any new software on my university servers. any help ? Thanks thamurath It seems you are using the standard library as a shared library