Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » standard thread ( error: 'thread' was not declared in this scope)
standard thread [message #46719] Wed, 20 July 2016 11:04 Go to previous message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Hi,

I tried to use the standard thread library and get error:

Quote:
error: 'thread' was not declared in this scope


#include <iostream>
#include <thread>

void myfunction()
{
	int nbr = 0;
	for(int i=0; i<1000; i++)
		nbr += (i%2 == 0)?1:0;
}

int main(int argc, const char *argv[])
{
	std::thread th(myfunction);
	th.join();
	
	return 0;
}


Do I need to change build parameter? add environment variable?

Thanks in advanced
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MDNS (Apple's Bonjour)
Next Topic: Send/receive files with SCP and launch commands with SSH
Goto Forum:
  


Current Time: Thu Mar 28 19:56:23 CET 2024

Total time taken to generate the page: 0.01878 seconds