注册 登录
编程论坛 VC++/MFC

openmp 编程的问题,报错不能打开文件

yongwu22 发布于 2010-11-23 23:53, 1606 次点击
#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)
希望高手加以指导!!!!!!!!!!!
1 回复
#2
shafeilong2010-11-28 22:26
#include <omp.h>   
换成"omp.h"看看
1