【发布时间】:2020-08-01 09:54:20
【问题描述】:
我正在尝试在 iOS 的 Flutter 中进行 C 互操作。
该代码使用 omp.h 并且在 Xcode 中编译它时显示 omp.h 未找到。
我试过的:
安装 OpenMP 库。
在 Xcode 中将编译器更改为 GCC,但没有找到任何方法。
在代码文件夹中手动包含
omp.h。
当手动包含 omp.h 时,它会运行,但现在我收到此错误:
Undefined symbols for architecture x86_64:
"_omp_init_nest_lock", referenced from:
_count_3_initialize in count_3_initialize.o
"_omp_destroy_nest_lock", referenced from:
_count_3_terminate in count_3_terminate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我尝试过使用dylib,但是出现了这个错误:
Unhandled Exception: Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, increment): symbol not found)
有人遇到过这样的问题吗?
【问题讨论】:
标签: c objective-c swift xcode flutter