【发布时间】:2018-06-15 02:08:39
【问题描述】:
我无法让 Clang 在 Windows 上与 MinGW 一起工作。 我安装了 MinGW-W64-builds-4.3.3 (GCC 7.2.0) 以及最新的 Clang/LLVM(通过网站上的安装程序)。
我正在编译:
-target x86_64-pc-windows-gnu
option 和 Clang 查找所有标题。不幸的是,当我使用 OpenMP 时,链接器出现错误。它看起来像这样:
: undefined reference to `__imp___kmpc_fork_call'
\libgomp.a(team.o):(.text+0x19): undefined reference to `pthread_mutex_destroy'
...
当我尝试使用 -fopenmp=libomp 标志时,我收到如下错误:
...: undefined reference to `__imp___kmpc_fork_call'
...: undefined reference to `__imp___kmpc_for_static_init_4'
...: undefined reference to `__imp___kmpc_for_static_fini'
...: undefined reference to `__imp___kmpc_barrier'
...
使用 GCC 编译时,一切正常。 有没有办法让它(openmp)在没有安装 Visual Studio 的情况下工作?如果没有,是否有一些最小化的 Visual Studio 安装程序只提取所需的库/头文件而不是整个 IDE 等?
我当然不知道我在这里做什么。像我一样解释五个答案非常感谢。
【问题讨论】:
-
-fopenmp=libiomp5可能会带来更好的运气(与您的问题类似:stackoverflow.com/questions/45983643/…)
标签: windows linker clang mingw openmp