【发布时间】:2020-11-05 13:33:55
【问题描述】:
我想在 MacOS 上安装 Boehm garbage collector 垃圾收集器。我查看了this 指南,但没有帮助;调用 brew install libgc 什么也没做。这是我尝试运行的示例代码:
#include <gc/gc.h>
int main() {
void* eight_bytes = GC_MALLOC(8);
}
很遗憾,我收到了这个错误:
Undefined symbols for architecture x86_64:
"_GC_malloc", referenced from:
_main in boehm_invocation-369838.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
有谁知道无需从源代码构建即可安装此 GC 的好方法吗?
【问题讨论】:
标签: c garbage-collection clang ld boehm-gc