This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53304] New: use of std::future results to relocation error with symbol _ZTINSt13__future_base19_Async_state_commonE
- From: "lts-rudolph at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 May 2012 09:04:46 +0000
- Subject: [Bug c++/53304] New: use of std::future results to relocation error with symbol _ZTINSt13__future_base19_Async_state_commonE
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: lts-rudolph@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 -----------