Error enabling openmp - quot;ld: library not found for -lgompquot; and Clang errors(启用 openmp 时出错 - “ld: library not found for -lgomp和 Clang 错误)
问题描述
我正在尝试让 openmp 在我的 Mavericks 程序中运行,但是当我尝试使用标志 -fopenmp
进行编译时,我收到以下错误:
I'm trying to get openmp to run in my program on Mavericks, however when I try to compile using the flag -fopenmp
I get the following error:
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我正在运行的命令是:
gcc myProgram.cpp -fopenmp -o myProgram
此外,当我运行 gcc 时,我会收到 Clang 警告,我觉得这很奇怪.并且查看/usr/bin/gcc 它似乎没有链接到 Clang.
Also, when I run gcc I get Clang warnings which I find to be very strange. And looking into /usr/bin/gcc it does not appear to link to Clang.
关于如何修复我的 Clang 错误并让 openmp 编译的任何建议?
Any suggestions on how to fix my Clang errors and get openmp to compile?
推荐答案
最新 Xcode 套件中的 gcc
命令不再是 LLVM 的 GCC 前端(基于非常旧的 GCC 4.2.1) 而是指向 clang
的符号链接.Clang(尚)不支持 OpenMP.您必须单独安装另一个版本的 GCC,例如通过遵循本教程或使用任何可用的软件包管理系统,如 MacPorts 和 家酿.
The gcc
command in the latest Xcode suite is no longer the GCC frontend to LLVM (based on the very old GCC 4.2.1) but rather a symlink to clang
. Clang does not (yet) support OpenMP. You have to install separately another version of GCC, e.g. by following this tutorial or by using any of the available software package management systems like MacPorts and Homebrew.
这篇关于启用 openmp 时出错 - “ld: library not found for -lgomp"和 Clang 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:启用 openmp 时出错 - “ld: library not found for -lgomp"和 Clang 错误


基础教程推荐
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 我有静态或动态 boost 库吗? 2021-01-01
- 常量变量在标题中不起作用 2021-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30