Hi Nim people!
I have successfully compiled the TA example shown here in Windows
https://www.ta-lib.org/d_api/ta_initialize.html
I'm capable even to really use the TA functions, not only initializing as described here: https://www.ta-lib.org/d_api/d_api.html
This is done in C!
I'm on Windows. I have downloaded precompiled binaries ta-lib-0.4.0-msvc.zip here:
https://www.ta-lib.org/hdr_dw.html
I'm compiling my C example described above and called ta.c like this:
batch
C:\Users\<me>\Desktop\NIM32\mingw32\bin\gcc.exe -c -I "C:\ta-lib\c\include" ta.c
C:\Users\<me>\Desktop\NIM32\mingw32\bin\gcc.exe -o ta.exe ta.o -L "C:\ta-lib\c\lib" -l ta_libc_cdd -l ta_libc_cdr
Note: C:ta-libcinclude contain headers C:ta-libclib contain precompiled static libraries
I'm using a 32 bit gcc in an isolated folder (not on system path) and everything is working fine. Compiler warns that they are static VS .lib libraries instead of .a, but I repeat everything is fine.
A question that arise naturally. How to do it in NIM?
Here is how I want to compile against static C libraries with a 32 bit compiler my quasi-empty ta.nim source file (probably wrong):
batch
nim c --gcc.path=C:\Users\<me>\Desktop\NIM32\mingw32\bin --cpu:i386 --dynlibOverrideAll -r ta.nim --passL="-L "C:\ta-lib\c\lib"" --passL="-l ta_libc_cdd" --passL="-l ta_libc_cdr" --passC=" -I "C:\ta-lib\c\include""
My ta.nim file in is quiet empty for the moment I say, except a hello world and a headache-try to link the h header for what I've seen in the documentation and forum...Probably I'm doing wrong...
{.header: "C:/ta-lib/c/include/ta_libc.h"}
{.link: "C:/ta-lib/c/lib/ta_libc_cdd.lib"}
{.link: "C:/ta-lib/c/lib/ta_libc_cdr.lib"}
echo "hello world"