如何正确编译Judy Array示例?

时间:2012-07-31 17:07:55

标签: arrays gcc compiler-construction

我正在尝试编译http://judy.sourceforge.net/doc/JudySL_3x.htm#JSLG给出的示例。我已按照发布内容下载了configure'd,make'和sudo make install d Judy库。但是,当我编译(Mac上的GCC)时,我收到以下错误:

Undefined symbols:
"_JudySLFreeArray", referenced from:
    _main in ccziTK43.o
"_JudySLNext", referenced from:
    _main in ccziTK43.o
"_JudySLIns", referenced from:
    _main in ccziTK43.o
"_JudySLFirst", referenced from:
    _main in ccziTK43.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

有人能指出我如何解决此问题的方向吗? (仅供记录,正在编译的文件是C模块,是的。)

另外,我的命令只是gcc test.c

1 个答案:

答案 0 :(得分:3)

您需要使用gcc选项告诉-l链接Judy库 - 例如

gcc -lJudy test.c