我有这样的代码:
#include <iostream>
#include <tbb/tbb.h>
#include <Windows.h>
bool MyThread(int something)
{
std::cout << "This is a thread function\n" << std::endl;
for (int i = 0; i < 10000; i++)
{
something++;
Sleep(1);
}
return true;
}
int main ()
{
tbb::tbb_thread pMyThread = tbb::tbb_thread(MyThread, 3);
pMyThread.join();
return 0;
}
但是,如果我在 VS 2008 中编译它,它会显示:错误 C2248:'tbb::internal::tbb_thread_v3::tbb_thread_v3':无法访问在类 'tbb::internal::tbb_thread_v3' 中声明的私有成员
对于 main() 函数的第一个字符串。我哪里错了?