Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to compile sources with ta-lib

Tags:

c

finance

I'm trying to use the ta-lib (http://ta-lib.org/) C API in my C application. I downloaded the sources of ta-lib, installed them on my system using make install. Library compiled successfully and I have its binaries in /usr/local/lib/. Then I compile my app as suggested on ta-lib site:

$ 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.

like image 755
nick Avatar asked Dec 29 '25 01:12

nick


1 Answers

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? 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? 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?


On my Mac, the library was installed as shown (after a couple of minutes compilation):

/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.

like image 92
Jonathan Leffler Avatar answered Dec 30 '25 17:12

Jonathan Leffler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!