libstdc++

Deploy Qt C++11 app on Mac OS with older libstdc++

妖精的绣舞 提交于 2019-12-11 11:27:31
问题 When I try to deploy my app on another machine, it fails with dyld /unresolved symbol errors. (Qt static release build, btw.) When I put libstdc++ in the bundle (along with libSystem.B and libobjc.A ) and run install_name_tool appropriately, I get new linker errors, for libraries upon which these libraries depend. E.g., libc++.1 . I'm really hoping I don't have to manually go through and run install_name_tool on every single library and its children. (Or write my own script, which I don't

_Gxx_Personality_v0 error with Codeblocks

浪子不回头ぞ 提交于 2019-12-11 08:28:47
问题 While trying to run C++ programs with MINGW & CODEBLOCKS I am getting the following error: The procedure entry point _gxx_persopnality _v0 could not be located in the dynamic link library libstdcc++-6.dll This is a picture of the current setting I am using. I am using g++ and NOT gcc : Note: I have added the path of MinGW to PATH (environment variables). Getting this error since I downloaded QT SDK & visual studio 2010 which comes with its own Mingw & VC with its own compiler. Reinstalled

Codependent types with unordered_map

痴心易碎 提交于 2019-12-11 04:29:14
问题 Suppose that I want to keep a certain ordering between the entries of an unordered_map<int, int>. A memory efficient way to do that seems to be keeping a linked list between the entries of the map. Namely instead of having an unordered_map<int, int>, I will use an unordered_map<int, Node> where Node is defined as struct Node { int val; typename std::unordered_map<int, Node>::iterator up; }; Is this valid C++? Clang and gcc do not permit this saying Node is an incomplete type. See below for

OS X libstdc++ prevents boost::thread from interruptions?

ε祈祈猫儿з 提交于 2019-12-11 04:05:31
问题 Consider the following sample code which creates a thread and interrupts it from the main thread using thread::interrupt call: #include <iostream> #include <boost/thread.hpp> #include <boost/chrono.hpp> #include <boost/ref.hpp> int main() { boost::thread t([]{ int counter = 0; while (1){ std::cout << "interruption enabled " << boost::this_thread::interruption_enabled() << std::endl; try { counter++; if (counter % 5 == 0) throw std::runtime_error("runtime error!"); std::cout << "thread

How to link in std C++ library on Mac OS X Mavericks?

醉酒当歌 提交于 2019-12-11 00:46:22
问题 I'm porting an application to OS X Darwin and am getting link errors with missing symbols like: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find_last_of(char const*, unsigned long, unsigned long) const operator delete[](void*) typeinfo for std::runtime_error std::set_unexpected(void (*)()) std::exception::~exception() [...] I expect these should come from libstdc++ but I don't see how to link that in using clang. Here is my attempted link line and

How does a C++ library implementation allocate memory but not free it when the program exits?

让人想犯罪 __ 提交于 2019-12-10 23:36:07
问题 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== possibly lost:

Using CUDA 8.0 with GCC 6.x - bad function overloading complaint

折月煮酒 提交于 2019-12-10 20:45:34
问题 I'm trying to build some CUDA code using GCC 6.2.1, the default compiler of my distribution (Note: not a GCC version officially supported by CUDA, so you can call this experimental). This is code which builds fine with GCC 4.9.3 and both CUDA versions 7.5 and 8.0. Well, if I build the following (close-to) minimal example: #include <tuple> int main() { return 0; } with the command-line nvcc -std=c++11 -Wno-deprecated-gpu-targets -o main main.cu I get the following errors: /usr/local/cuda/bin/.

Free Pascal/C++ project crashes in cout::sentry

你。 提交于 2019-12-10 18:51:16
问题 I have a mixed Free Pascal/C++ project. Debian 5.0 ("Lenny") on i386, FPC 2.4.4. When I run the program, it crashes on the first cout<< call. Funnily, it used to work for some time; some OS update probably broke it. Here's the issue isolated: p.pas: {$L c.o} program p; uses initc; procedure Hello; cdecl; external name 'Hello'; begin Hello; end. c.cpp: #include <iostream> //void * __dso_handle; //You might need to uncomment that extern "C" void Hello() { std::cout << "Hello world"; } Makefile:

Can an application depend on two different versions of libstdc++?

主宰稳场 提交于 2019-12-10 16:19:46
问题 Can an application depend on two different versions of libstdc++ at the same time? (e.g.: libstdc++5 and libstdc++6)? The scenario being - some binary depends on libstdc++ 6 but loads an .so that depends on libstdc++5... Will that have any chance of working? 回答1: Most importantly, you need to check if those two versions of the library are binary compatible or not. G++ 3.3 and 3.4 are not, for example. And even if they are: * There can be name mangling issues * You cannot do cross module

_GLIBCXX_USE_CXX11_ABI disabled on RHEL6 and RHEL7?

风格不统一 提交于 2019-12-10 15:56:58
问题 I have gcc 5.2.1 on RHEL6 and RHEL7, and it looks like _GLIBCXX_USE_CXX11_ABI gets disabled. It's not working even if I manually run -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14 . This means I won't get small string optimization feature. For example, the output of following code always have 8 and 'micro not set'. For SSO, size of std::string should be at least 16 if we look at code bits/basic_string.h. Any workaround? #include <string> #include <iostream> int main() { std::cout << sizeof(std::string