nrz*_*nrz 0 c gcc compiler-errors common-lisp ecl
我正在尝试编译一个嵌入ECL的C程序示例,其中包含对C函数的回调. github.我已经安装了ECL(嵌入式的Common Lisp)通过克隆ECL回购git clone git://git.code.sf.net/p/ecls/ecl ecl,然后$ make和# make install,并安装似乎正常,至少ECL开发人员指南:2.6编译器例子编译的罚款.
当我尝试编译ecldemo.c时,gcc ecldemo.c -lecl我收到以下错误:
/usr/bin/ld: error: cannot find -lecl
/tmp/ccRk8Q48.o:ecldemo.c:function foo: error: undefined reference to 'ecl_make_integer'
/tmp/ccRk8Q48.o:ecldemo.c:function bar: error: undefined reference to 'ecl_make_integer'
/tmp/ccRk8Q48.o:ecldemo.c:function ecl_call: error: undefined reference to 'ecl_make_simple_base_string'
/tmp/ccRk8Q48.o:ecldemo.c:function ecl_call: error: undefined reference to 'si_string_to_object'
/tmp/ccRk8Q48.o:ecldemo.c:function ecl_call: error: undefined reference to 'si_safe_eval'
/tmp/ccRk8Q48.o:ecldemo.c:function init: error: undefined reference to 'cl_boot'
/tmp/ccRk8Q48.o:ecldemo.c:function init: error: undefined reference to 'cl_shutdown'
/tmp/ccRk8Q48.o:ecldemo.c:function init: error: undefined reference to 'ecl_make_simple_base_string'
/tmp/ccRk8Q48.o:ecldemo.c:function init: error: undefined reference to 'si_string_to_object'
/tmp/ccRk8Q48.o:ecldemo.c:function init: error: undefined reference to 'ecl_def_c_function'
/tmp/ccRk8Q48.o:ecldemo.c:function init: error: undefined reference to 'ecl_make_simple_base_string'
/tmp/ccRk8Q48.o:ecldemo.c:function init: error: undefined reference to 'si_string_to_object'
/tmp/ccRk8Q48.o:ecldemo.c:function init: error: undefined reference to 'ecl_def_c_function'
/tmp/ccRk8Q48.o:ecldemo.c:function main: error: undefined reference to 'ecl_make_simple_base_string'
/tmp/ccRk8Q48.o:ecldemo.c:function main: error: undefined reference to 'si_string_to_object'
/tmp/ccRk8Q48.o:ecldemo.c:function main: error: undefined reference to 'si_safe_eval'
/tmp/ccRk8Q48.o:ecldemo.c:function main: error: undefined reference to 'cl_print'
/tmp/ccRk8Q48.o:ecldemo.c:function main: error: undefined reference to 'cl_equal'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
我想知道这个错误行:
/usr/bin/ld: error: cannot find -lecl
Run Code Online (Sandbox Code Playgroud)
在我看来,gcc不知何故解释-lecl为源文件,而不是作为选项-l library(搜索名为库library)的选项.在-l和ecl(gcc ecldemo.c -l ecl)之间留一个空格没有帮助,输出是相同的(cannot find -lecl).
由于ecl.h位于/usr/local/include/ecl/和ecldemo.c它附带的#include "ecl/ecl.h",我尝试添加一个图书馆目录中-L选择:
gcc -L /usr/local/include/ecl ecldemo.c -l ecl
......但无济于事,同样的错误usr/bin/ld: error: cannot find -lecl仍然存在.
任何可能导致此错误的想法以及如何解决这个问题?