Xcode C++ omp.h file not found

谁说胖子不能爱 提交于 2021-02-10 06:22:34

问题


I’m trying to include openmp to my Xcode C++ project. I have changed my compiler in Xcode to LLVM GCC 4.2, added ”-fopenmp” as a CFlag and enabled OpenMP support in xcode as well. But it still says ”‘omp.h’ file not found” and i am unable to build the project. Does anyone know what could be wrong and how to fix this?


回答1:


I have had the same problem. Try going to the project navigator using the panel at the left side. Select your project (the one with the blue icon), and a different main window appears. Here, click the relevant file under "Targets" and choose the "Build settings" and "All". Here, search for OpenMP. In my system, it shows up under "LLVM GCC 4.2 - Language". Set "Enable OpenMP Support" to Yes. This should make it work. Make sure to not manually #include "omp.h".

The weird thing is that I don't know how to do this "manually" (i.e. circumventing the built-in Xcode I approach described above).



来源:https://stackoverflow.com/questions/13999255/xcode-c-omp-h-file-not-found

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