OSX 10.6 Snow Leopard에서 http://www.erlang.org/doc/tutorial/nif.html으로 놀고 있습니다. 예제를 실행하는 데 문제가 있습니다.에얼랑 런타임에 잘못된 아키텍처가 있습니까?
내가 사용하여 컴파일 :
gcc -o complex_nif.so -fpic -I/usr/local/lib/erlang/usr/include -flat_namespace -undefined suppress complex.c complex_nif.c
및 사용 얼랑에서 실행 : 나는 내가하는 .so 파일을 찾는거야 볼
Erlang R15B01 (erts-5.9.1) [source] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.9.1 (abort with ^G)
1> c(complex).
{error,on_load_failure}
=ERROR REPORT==== 4-Apr-2013::15:24:51 ===
Error in process <0.37.0> with exit value: {{badmatch,{error,{load_failed,"Failed to load NIF library: 'dlopen(./complex_nif.so, 2): no suitable image found. Did find:\n ./complex_nif.so: mach-o, but wrong architecture'"}}},[{complex,init,0,[{file,"...
=ERROR REPORT==== 4-Apr-2013::15:24:51 ===
The on_load function for module complex returned {{badmatch,
{error,
{load_failed,
"Failed to load NIF library: 'dlopen(./complex_nif.so, 2): no suitable image found. Did find:\n\t./complex_nif.so: mach-o, but wrong architecture'"}}},
[{complex,init,0,
[{file,...},{...}]},
{code_server,
'-handle_on_load/4-fun-0-',
1,
[{...}|...]}]}
합니다. 하지만 erlang은 컴파일 된 아키텍쳐를 좋아하지 않는다. 어떤 아키텍쳐가 선호하는 아키텍처인가?
32 비트 VS 64 비트? –
@ RobertoAloi, 나는 -m32와 -m64를 모두 시도했지만 아무런 차이점이 없습니다. –