¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

trouble linking twsapi


 

Hello Folks,

I have downloaded the tws-api 10.12 for Mac to a macbook pro running an intel i7 with macos 11.2.1.

I get a link error when running?IBJts/samples/Cpp/TestCppClient/make

(see below) It looks to me like the library libbid.a is incorrect for my architecture, but everything I read indicates that this is the correct file.

Any advice is greatly appreciated!

-Eric

ld: warning: ignoring file ../../../source/cppclient/client/lib/libbid.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )

Undefined symbols for architecture x86_64:

? "___bid64_from_string", referenced from:

? ? ? stringToDecimal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in EDecoder-5533e2.o

? ? ? stringToDecimal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in TestCppClient-3ecfd4.o

? "___bid64_to_string", referenced from:

? ? ? decimalToString(unsigned long long) in EClient-244261.o

? ? ? decimalToString(unsigned long long) in TestCppClient-3ecfd4.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)





 

Hey having this same issue. Have tried a bunch of things but seems like libbid.a is the culprit. I know it's been a year but hoping someone can help. Thanks!


 

The libbid.a file they've provided is faulty, try re-making that file manually after cloning its repo from github


 

Thanks! Pretty surprising that they didn't catch this.

Tried installing the file from??but when I run it for OSX (after having to fix some code in the source files) I get around 16 files in the form "gcc###libbid.a" and "gcc###blibbid.a" where the "###" range from 000 to 111. If I change the makefile link to one of these I can compile the sample TestCppClient comes with the api but get a seg fault when executing the program (which I assume has to do with the libbid file I'm using). Is there a recommended place to find a compatible file?


 

I guess it's because you use 000, which if I remember well require that you call by reference.
Try 100

I use
Look at the readme and bid_conf.h
Makefile does generate a bunch of variety of lib to deal with various implementation and calling convention.

Things like
First digit require that you do use calling by reference. 100 is by value etc ...
Second digit is rounding options.
Third is about a global config for some implementation definition of exception.

I think I use 100blibbid
I use "by value" because the hidden type is 64 bits, which is same size as a ptr (64 bit cpu), it help (marginally) compilers to optimize procedure.

so either you learn the naming convention of the lib(s) you need,
or workaround you directly put the source file of the "Decimal" lib in your IBKR lib project compile and debug to see if it fits your calling convention.
There are only a dozen .c files needed. Not pretty but allow easier debug of it.


 

Is there a direct place to file bugs with IBKR - checked github didnt see issues section open there.


 

Ok I am having some seg fault issues as well running on ubuntu.?

I can compile the exact same code on windows, vscode,win32. The library there is different though.?

Did you ever find a resolution??