openmp 编程的问题,报错不能打开文件
#include <omp.h> #include <stdio.h>
#include <stdlib.h>
void Test (int n)
{
for (int i = 0; i < 10000; ++i)
{
//do nothing, just waste time }
printf("%d, ", n); }
int main(int argc, char* argv[])
{
#pragma omp parallel for
for (int i = 0; i < 10; ++i)
Test( i );
system("pause");
}
报错:
Compiling...
1.cpp
D:\软件\Microsoft Visual Studio\workplace\switch\openmp\1.cpp(2) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
D:\软件\Microsoft Visual Studio\workplace\switch\openmp\1.cpp(2) : fatal error C1083: Cannot open include file: 'omp.h': No such file or directory
Error executing cl.exe.
1.obj - 1 error(s), 1 warning(s)
希望高手加以指导!!!!!!!!!!!