libstdc++

GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

末鹿安然 提交于 2019-12-03 12:27:54
Apologies, I understand questions very similar to this have been asked relatively often, although none of the solutions seem to work for me.When attempting to run any c++ code of a reasonable complexity, I get the above error. The full error message is: /main: relocation error: ./main: symbol _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference running another project, I get a very similar error: ./main: relocation error: ./main: symbol _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev, version

GCC compatibility of shared libraries with STL objects in their interface

时光总嘲笑我的痴心妄想 提交于 2019-12-03 10:55:22
I have an application with STL objects used as part of the C++ interface for plug-in writers. I know the best option for compatibility would have been to use a C interface instead, but that's not currently feasible. I know that everything from GCC 3.4 to 4.8 in libstdc++ has been highly compatible in terms of ABI. So for example, if I compile with GCC 4.1, and a plug-in vendor writes code compiled with GCC 4.7, then barring corner cases all will be well on a platform with a libstdc++ version corresponding to GCC 4.7 or later, provided STL useage is internal to the .so only, and that the

C++11: write move constructor with atomic<bool> member?

亡梦爱人 提交于 2019-12-03 05:36:30
问题 I've got a class with an atomic member variable: struct Foo { std::atomic<bool> bar; /* ... lots of other stuff, not relevant here ... */ Foo() : bar( false ) {} /* Trivial implementation fails in gcc 4.7 with: * error: use of deleted function ‘std::atomic<bool>::atomic(const td::atomic<bool>&)’ */ Foo( Foo&& other ) : bar( other.bar ) {} }; Foo f; Foo f2(std::move(f)); // use the move How should be move constructor look like? Gcc 4.7 doesn't like any of my attempts (like adding std::move()

GLIBCXX_3.4.9 not found

久未见 提交于 2019-12-03 04:42:48
问题 I have a problem concerning libstdc++.so . I installed a new version of gcc and tried to compile C++ code. The compiling worked, but when I try to execute the binary ( m5.opt is its name) I've got the following error: build/ALPHA_SE/m5.opt: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by build/ALPHA_SE/m5.opt). Do I need to replace libstdc++.so ? And if so, where can I download the version I want? On the GCC-website they say libstdc++ is a part of gcc now. Details

Why don't memory allocators actively return freed memory to the OS?

女生的网名这么多〃 提交于 2019-12-03 04:42:31
Yes, this might be the third time you see this code, because I asked two other questions about it ( this and this ).. The code is fairly simple: #include <vector> int main() { std::vector<int> v; } Then I build and run it with Valgrind on Linux: g++ test.cc && valgrind ./a.out ==8511== Memcheck, a memory error detector ... ==8511== HEAP SUMMARY: ==8511== in use at exit: 72,704 bytes in 1 blocks ==8511== total heap usage: 1 allocs, 0 frees, 72,704 bytes allocated ==8511== ==8511== LEAK SUMMARY: ==8511== definitely lost: 0 bytes in 0 blocks ==8511== indirectly lost: 0 bytes in 0 blocks ==8511==

libstdc++ parallel mode: Who's using it? Is it safe? Any similar projects? [closed]

半世苍凉 提交于 2019-12-03 04:24:56
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . the GNU implementation of the C++ Library supports a parallel mode, explained here. Any experiences in using it? Good ones? Bad ones? Especially regarding correctness, but also performance. Are there some "more or less serious" projects using it? Do you use it with the global

How to link C++ object files with ld

筅森魡賤 提交于 2019-12-02 21:52:33
I'm trying to link the output of C++ using ld and not g++. I'm only doing this to learn how to do it, not for practical purposes, so please don't suggest just to do it with g++. Looking at this question , the person gets the same error when they run the ld command: $ ld test.o -o test.out ld: warning: cannot find entry symbol _start; defaulting to 00000000004000e8 test.o: In function `main': test.cpp:(.text+0x1c): undefined reference to `strcasecmp' test.cpp:(.text+0x23): undefined reference to `std::cout' test.cpp:(.text+0x28): undefined reference to `std::ostream::operator<<(int)' test.cpp:(

C++11: write move constructor with atomic<bool> member?

时光怂恿深爱的人放手 提交于 2019-12-02 20:20:48
I've got a class with an atomic member variable: struct Foo { std::atomic<bool> bar; /* ... lots of other stuff, not relevant here ... */ Foo() : bar( false ) {} /* Trivial implementation fails in gcc 4.7 with: * error: use of deleted function ‘std::atomic<bool>::atomic(const td::atomic<bool>&)’ */ Foo( Foo&& other ) : bar( other.bar ) {} }; Foo f; Foo f2(std::move(f)); // use the move How should be move constructor look like? Gcc 4.7 doesn't like any of my attempts (like adding std::move() around the other.bar ) and the net is surprisingly quiet here... Since you're moving other , no one else

GLIBCXX_3.4.9 not found

早过忘川 提交于 2019-12-02 17:12:18
I have a problem concerning libstdc++.so . I installed a new version of gcc and tried to compile C++ code. The compiling worked, but when I try to execute the binary ( m5.opt is its name) I've got the following error: build/ALPHA_SE/m5.opt: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by build/ALPHA_SE/m5.opt). Do I need to replace libstdc++.so ? And if so, where can I download the version I want? On the GCC-website they say libstdc++ is a part of gcc now. Details GCC: I had gcc 4.1.2 before, but I downloaded gcc 4.2.4. From the untarred gcc-directory I executed .

very basic regex scenario works different than my expectation on libstdc++-v3

安稳与你 提交于 2019-12-02 12:11:32
问题 I'm getting a different behavior than my expectation (and also different than Microsoft C++). Consider the following test.cpp file: #include <iostream> #include <ostream> #include <regex> int main( void ) { std::regex rx( "a(b+)(c+)d" ); std::string s( "abbbbccd" ); std::smatch m; bool f = regex_match( s, m, rx ); std::cout << std::boolalpha << f << std::endl; if( f ) { std::cout << "m[1]=" << m[1] << std::endl; std::cout << "m[2]=" << m[2] << std::endl; } return 0; } On my Ubuntu Oneiric box