[英]Unable to compile sources with ta-lib
I'm trying to use the ta-lib ( http://ta-lib.org/ ) C API in my C application. 我正在尝试在我的C应用程序中使用ta-lib( http://ta-lib.org/ )C API。 I downloaded the sources of ta-lib, installed them on my system using make install.
我下载了ta-lib的源代码,并使用make install将它们安装在我的系统上。 Library compiled successfully and I have its binaries in
/usr/local/lib/
. 库已成功编译,并且我的二进制文件在
/usr/local/lib/
。 Then I compile my app as suggested on ta-lib site: 然后按照ta-lib网站上的建议编译我的应用程序:
$ gcc -L/usr/local/lib -lta-lib -o tlc talib_test.c
/usr/bin/ld: cannot find -lta-lib
collect2: ld returned 1 exit status
$
Any ideas what's going wrong? 任何想法出什么事了吗?
OS: I'm using Ubuntu 9. 操作系统:我正在使用Ubuntu 9。
Is there any chance that you have installed a 32-bit copy of libta-lib.so
and are compiling a 64-bit test program, or vice versa? 您是否有可能安装了
libta-lib.so
的32位副本并正在编译64位测试程序,反之亦然? That is, could you have a mismatch in the type of library? 也就是说,您可能在库类型上有不匹配吗?
Failing that, have you looked at /usr/local/lib
to check that you have libta-lib.so
in there? 失败了,您是否查看过
/usr/local/lib
以检查其中是否有libta-lib.so
? Or could it be that the library is actually called libta.so
or something like that, so you need to specify -lta
on the command line? 还是可能是该库实际上被称为
libta.so
或类似的名称,所以您需要在命令行上指定-lta
?
On my Mac, the library was installed as shown (after a couple of minutes compilation): 在我的Mac上,库如图所示安装(经过几分钟的编译):
/usr/bin/install -c .libs/libta_lib.lai /usr/gnu64/lib/libta_lib.la
/usr/bin/install -c .libs/libta_lib.a /usr/gnu64/lib/libta_lib.a
This would require -lta_lib
with an underscore instead of -lta-lib
with a dash. 这将需要
-lta_lib
带下划线,而不是-lta-lib
带破折号。
Where is libta-lib.a ? libta-lib.a在哪里? The error message suggests the linker cant find the library.
该错误信息表明链接器找不到该库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.