help with openmp compilation problems

浪子不回头ぞ 提交于 2019-12-10 23:29:51

问题


I'm trying to use omp in my C code and am having a problem: in the code i have #include but when i try to compile with:

g++ -fopenmp -g -c parallel.c

I get cc1plus: error: unrecognized command line option "fopenmp" and when i try:

g++ -g -c parallel.c

I get an error for both:

omp.h: No such file or directory, and malloc not declared in this scope

i tried with gcc with -fopenmp and get the same error. without the -fopenmp i still get the missing omp.


回答1:


OpenMP is only supported in gcc 4.2 and higher. You might need to upgrade your compiler.



来源:https://stackoverflow.com/questions/4375165/help-with-openmp-compilation-problems

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!