Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
TWS API 10.20 c++ windows
Hello,
i have a basic question and i am sure this is boring for the most of you but I NEED YOUR HELP. I am using the API since years but til now i have used an old on. The old API software i have c# and coliped it with nmake. No problem on this. NOW, i have to switch to API 10.20. And i have problem to compile the c++ code on windows. Did anyone of you have a good dicription that a normal people like me ould understand an can compile the 10.20 API c++ on windows. I would be very thankful if anyone of you could send me some information. Sorry again for this basic question. Best regards Thobi |
Franco Chiesa Docampo
toggle quoted message
Show quoted text
El 31 ene. 2023, a la(s) 16:43, Andrew Bannerman <bannerman1985@...> escribi¨®:
|
The TWS API source code comes with Visual Studio solution files which would only work with Visual Studio (not Visual Studio Code).
You would have to make all the configs yourself to get running in VS Code but why bother when VS is also free and far better for debugging. Note someone mentioned below about switching to Win32. This is because the .SLN file only comes with Win32 configs but it is really easy to create x64 configs. Basically just duplicate the Win32 configs under x64. I use TWS API C++ under Visual Studio 2020 Preview with C++ Latest standard set with x64 configs and never have any problems. The biggest headache of recent has been the switch to DECIMAL. For that I use VCPKG and installed the "intelrdfpmathlib"? which covers all the Decimal Floating Point Math libraries you will need. |
Franco Chiesa Docampo
toggle quoted message
Show quoted text
El 31 ene. 2023, a la(s) 23:49, David Armour <dave.armour@...> escribi¨®:
|
This is more a general C++ compiling question.
You can either link in libraries "statically" which means they are embedded in your .exe file, or they can be linked "dynamically" which means they call the library functions that reside in a .dll file that sits outside of your .exe file. The "supposed" benefit of using .dlls is that you can change the dll without changing your code, but I personally do not like to do that since the changes in dlls could break your code. It is really a matter of taste (and of course using DLLs means your ,exe size is much smaller). As for TwsClient and TwsClientStatic, they are the two versions mentioned above. One uses a .DLL (TwsSocketClient.dll) and the other gets statically linked to your code so does not need any DLL. |
On Tue, Jan 31, 2023 at 06:49 PM, David Armour wrote:
"intelrdfpmathlib"Hi David,? I have installed VCPKG and "intelrdfmathlib" but still getting 2 (3) errors trying to compile to x64. Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol __bid64_from_string referenced in function "unsigned __int64 __cdecl stringToDecimal(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?stringToDecimal@@YA_KV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) TwsSocketClient C:\TWS API\source\CppClient\client\EDecoder.obj 1
I have changed configuration to x64 here Win32 does compile well but i would like to compile it to x64 if possible. |
This linker error looks like it cannot find the intel math library.
Did you install the intelrdfmathlib with the correct triplet to compile with x64? Make sure you install either: intelrdfpmathlib:x64-windows-static or intelrdfpmathlib:x64-windows depending whether you use static libs or not. You probably go Win32 to compile because you installed the Win32 lib. |
to navigate to use esc to dismiss