Where are ffi symbols defined?

时光怂恿深爱的人放手 提交于 2019-12-12 06:27:55

问题


I am trying to link a file, "lib guile_2.0_la-foreign.o" in order to build guile-2.0.11 on macOS Sierra. The ld command from the make file returns more than a dozen errors similar to

"_ffi_type_float", referenced from:
_fill_ffi_type in lib guile_2.0_la-foreign.o

ld: symbol(s) not found for architecture x86_64

where the "_ffi_type_xxx" varies in the "xxx" position. I have installed libffi with hombrew, and have told CPPFLAGS and LDFLAGS where to find the lib and include directories, but I still get the same error. Where are these symbols to be found?


回答1:


In Makefile, there is an environment variable (LIBFFI_LIBS) that specifies the path to the ffi library. I was missing the flag telling the linker to actually link the library.

I changed its value from LIBFFI_LIBS="-L/usr/local/opt/libffi/lib" to LIBFFI_LIBS="-L/usr/local/opt/libffi/lib -lffi" and all errors about undefined ffi symbols have now disappeared.



来源:https://stackoverflow.com/questions/45062678/where-are-ffi-symbols-defined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!