OpenMP和manifest,了解openmp的请进
在控制台程序中练习openMP的例子,编译可以通过,但是运行时出错。(VS2005 + XP SP2)
int TestOpenMP()
{
#pragma omp parallel for
for (int i = 0; i < 10; i++ )
{
printf( "i = %d\n ", i);
}
return 0;
}
除了弹出错误信息如下:应用程序正常初始化(0xc0000142)失败.请单击确定终止应用程序。
在程序的控制台中还有如下错误信息,
Error: r6034
An application has made an attempt to load vcompd.dll without using a manifest.
this is an unsupported way to load Visual C++ DLLs. You need to modify your application
to build with a manifest.
For more information , see the "Visual C++ Libraries as shared Side-by-Side Assembles "
topic in the product documentation.
[解决办法]
打开项目属性,
configuration->
linker->
manifest file->
在 additional manifest dependencies 中添加
type= 'win32 ' name= 'Microsoft.VC80.DebugOpenMP ' version= '8.0.50727.762 ' processorArchitecture= 'x86 ' publicKeyToken= '1fc8b3b9a1e18e3b '