找不到 Xcode C++ omp.h 文件 [英] Xcode C++ omp.h file not found

查看:178
本文介绍了找不到 Xcode C++ omp.h 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 openmp 包含到我的 Xcode C++ 项目中.我已将 Xcode 中的编译器更改为 LLVM GCC 4.2,添加了-fopenmp"作为 CFlag,并在 xcode 中启用了 OpenMP 支持.但它仍然说找不到‘omp.h’文件",我无法构建项目.有谁知道可能出了什么问题以及如何解决这个问题?

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.在我的系统中,它显示在LLVM GCC 4.2 - 语言"下.将启用 OpenMP 支持"设置为是.这应该使它工作.确保不要手动#include "omp.h".

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".

奇怪的是,我不知道如何手动"执行此操作(即绕过我上面描述的内置 Xcode 方法).

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 C++ omp.h 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆