defining shared_ptr causes segfault (CMake)
问题 While setting up a new project (using CMake, compiler is gcc version 5.2.1, ubuntu (15.10)), I wanted to use a shared_ptr. This simple main.cpp works fine: #include <iostream> #include <memory> using namespace std; int main() { cout<<"Hi there!"<<endl; return 0; } But just defining a shared_ptr will cause the program to crash with segfault before even writing "Hi there!". #include <iostream> #include <memory> using namespace std; int main() { cout<<"Hi there!"<<endl; shared_ptr<double> test;