http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53304
Bug #: 53304 Summary: use of std::future results to relocation error with symbol _ZTINSt13__future_base19_Async_state_commonE Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: lts-rudo...@gmx.de The example did not run if compiled with 4.7.0 but runs as expected with 4.6.3 Error: krud@x:~/test/c++/c++11/thread_future_promise$ go go: relocation error: go: symbol _ZTINSt13__future_base19_Async_state_commonE, version GLIBCXX_3.4.17 not defined in file libstdc++.so.6 with link time reference comiled with ---- start makefile -------- all: go #CXX=/opt/linux-gnu_4.6.3/bin/g++ CXX=/opt/linux-gnu_4.7.0/bin/g++ CXXFLAGS=-pthread -std=c++0x -O2 -g LDFLAGS=-pthread -g go: main.o $(CXX) $< $(LDFLAGS) -o go ------- end Makefile -------- ------- start main.cpp -------- #include <iostream> #define _GLIBCXX_USE_NANOSLEEP #include <thread> #include <future> using namespace std; int main() { future<int> retval= async( [] { this_thread::sleep_for( chrono::seconds(1)); return 42; } ); cout << "Result " << retval.get() << endl; return 0; } ------ end main.cpp -----------