Olá, eu estou a usar o mingw, versão 32-bits no windows 7 Ultimate e estou com problemas a utilizar threads.
Eu sei que não funcionam para esta versão do mingw, razão pela qual uso a versão neste link. Mas eu não compila este exemplo, porque diz que
In static member function 'static unsigned int mingw_stdthread::thread::_hardware_concurrency_helper()':
error: '::GetNativeSystemInfo' has not been declared (in line 266)
Isto no ficheiro thread que fiz download, testei neste site e funcionou este exemplo, alguém me poderia dizer o porquê de isto acontecer?
#include <iostream> // std::cout
#include <thread> // std::thread
class test {
public:
static void foo(){}
static void bar(int x){}
test(){
std::thread first (foo); // spawn new thread that calls foo()
std::thread second (bar,0); // spawn new thread that calls bar(0)
first.join(); // pauses until first finishes
second.join(); // pauses until second finishes
}
};
int main() {
test TESTE;
return 0;
}