二郎山NIF测试 - OS X狮子 [英] Erlang NIF Test -- OS X Lion
本文介绍了二郎山NIF测试 - OS X狮子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图编译从二郎山NIF测试( HTTP:// WWW。 erlang.org/doc/man/erl_nif.html )在Mac OS X狮子。我不能让它编译。我缺少一个编译器标志?这是我得到的错误:
I'm trying to compile the NIF Test from Erlang (http://www.erlang.org/doc/man/erl_nif.html) on Mac OS X Lion. I can't get it to compile. Am I missing a compiler flag? Here's the error I get:
Computer:~ me $ gcc -fPIC -shared -o niftest.so niftest.c -I /usr/local/Cellar/erlang/R14B02/lib/erlang/usr/include/
Undefined symbols for architecture x86_64:
"_enif_make_string", referenced from:
_hello in ccXfh0oG.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
我也试图与 -m32
,但它说,没有i386架构无论是。
I've also tried this with -m32
but it says there's no i386 architecture either.
谢谢!
推荐答案
64位二郎,对我来说了以下工作:
for 64-bit Erlang, the following works for me:
gcc -undefined dynamic_lookup -dynamiclib niftest.c -o niftest.so \
-I /usr/local/Cellar/erlang/R14B02/lib/erlang/usr/include
这篇关于二郎山NIF测试 - OS X狮子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文