找不到 Xcode C++ omp.h 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13999255/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode C++ omp.h file not found
提问by Uffe
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?
我正在尝试将 openmp 包含到我的 Xcode C++ 项目中。我已将 Xcode 中的编译器更改为 LLVM GCC 4.2,添加了“-fopenmp”作为 CFlag,并在 xcode 中启用了 OpenMP 支持。但它仍然说“找不到'omp.h'文件”并且我无法构建该项目。有谁知道可能出什么问题以及如何解决这个问题?
回答by Superpronker
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".
我曾经也有过一样的问题。尝试使用左侧的面板转到项目导航器。选择您的项目(带有蓝色图标的项目),然后会出现一个不同的主窗口。在这里,单击“目标”下的相关文件,然后选择“构建设置”和“全部”。在这里,搜索 OpenMP。在我的系统中,它显示在“LLVM GCC 4.2 - 语言”下。将“启用 OpenMP 支持”设置为是。这应该使它工作。确保不要手动#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).
奇怪的是,我不知道如何“手动”执行此操作(即绕过我上面描述的内置 Xcode 方法)。