mortensorensen / qinteractivebrokers Goto Github PK
View Code? Open in Web Editor NEWQ wrapper for the Interactive Brokers API
Q wrapper for the Interactive Brokers API
Hi,
Thanks for the great work.
I am getting the below error when installing in my Centos7 64 bit. Googled for a while but no sound solution. Would you have any idea? Thanks!
[build]$ make
Scanning dependencies of target qib.0.0.1
[ 33%] Building CXX object CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o
c++: error: i386: No such file or directory
c++: error: unrecognized command line option ‘-arch’
make[2]: *** [CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o] Error 1
make[1]: *** [CMakeFiles/qib.0.0.1.dir/all] Error 2
make: *** [all] Error 2
Hi Morten,
Thanks for sharing the codes!
I am using a 64bit machine, so change m32 to m64. And I must un-commented CXXFLAGS += -fPIC -shared to build successfully.
But I got error when loading the feed_handle.so into kdb+.
Error:
feed_handler.so: undefined symbol:_ZN21B18EPosixClientSocketC1EPNS_8EWrapperE
Will be great if you could help.
Cheers
Thanks for putting this up on git hub, I'm impressed! Could you add a q-script with bindings that you use and examples of q-scripts with queries / place order to get me started?
Hi @mortensorensen,
When trying to compile on Debian, I get the ‘get_time’ is not a member of ‘std’
error.
Also note that cmake -DBUILD_x64 ..
as per README instructions doesn't work, so I used cmake -BUILD_x64 ..
[dk@server /home/dk/qib/build]$ uname -a
Linux s110519 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
[dk@server /home/dk/qib]$ mkdir build && cd build
[dk@server /home/dk/qib/build]$ cmake -DBUILD_x64 ..
Parse error in command line argument: -DBUILD_x64
Should be: VAR:type=value
CMake Error: No cmake script provided.
CMake Error: Problem processing arguments. Aborting.
[dk@server /home/dk/qib/build]$ cmake -BUILD_x64 ..
-- The CXX compiler identification is GNU 4.9.2
-- The C compiler identification is GNU 4.9.2
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dk/qib/build
[dk@server /home/dk/qib/build]$ make
Scanning dependencies of target qib.0.0.1
[ 33%] Building CXX object CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o
In file included from /home/dk/qib/third_party/ib/IBJts/source/PosixClient/Shared/IBString.h:8:0,
from /home/dk/qib/third_party/ib/IBJts/source/PosixClient/Shared/EWrapper.h:8,
from /home/dk/qib/src/IBClient.h:4,
from /home/dk/qib/src/IBClient.cpp:1:
/usr/include/c++/4.9/string:38:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.
CMakeFiles/qib.0.0.1.dir/build.make:62: recipe for target 'CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o' failed
make[2]: *** [CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/qib.0.0.1.dir/all' failed
make[1]: *** [CMakeFiles/qib.0.0.1.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I have installed the missing g++-multilib
following the advice on: https://askubuntu.com/questions/709893/14-04-01-32-bit-missing-g-64-bit-include-files-when-cross-compiling :
[dk@server /home/dk/qib/build]$ sudo apt-get install g++-multilib
Another attempt then generates the error:
[dk@server /home/dk/qib/build]$ make
[ 33%] Building CXX object CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o
/home/dk/qib/src/IBClient.cpp: In member function ‘k0* IBClient::convertExecution(const Execution&)’:
/home/dk/qib/src/IBClient.cpp:251:11: error: ‘get_time’ is not a member of ‘std’
ss >> std::get_time(&time, "%Y%m%d %T");
^
CMakeFiles/qib.0.0.1.dir/build.make:62: recipe for target 'CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o' failed
make[2]: *** [CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/qib.0.0.1.dir/all' failed
make[1]: *** [CMakeFiles/qib.0.0.1.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Perhaps g++ -std=c++11
option as per this?
Any suggestions appreciated.
EDIT:
I suspect I need to upgrade my gcc/g++ version on Debian Jessie for c++11 standards support. I will do that and keep you updated.
[dk@server /home/dk/qib/build]$ g++ --version
g++ (Debian 4.9.2-10+deb8u1) 4.9.2
[dk@server /home/dk/qib/build]$ gcc --version
gcc (Debian 4.9.2-10+deb8u1) 4.9.2
Hi mortensorensen,
May I know what compilers and their versions you using?
I have tried GCC and Clang but both failed. It seems the codes are correct but just not compatible with the compilers I am using.
Logs attached below.
Thanks and Happy New Year!
-- The CXX compiler identification is Clang 3.5.0
-- The C compiler identification is Clang 3.5.0
[bluethoughts@vm build]$ make
[ 33%] Building CXX object CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o
In file included from /home/bluethoughts/projects/QInteractiveBrokers-master/src/IBClient.cpp:1:
In file included from /home/bluethoughts/projects/QInteractiveBrokers-master/src/IBClient.h:4:
In file included from /home/bluethoughts/projects/QInteractiveBrokers-master/third_party/ib/IBJts/source/PosixClient/Shared/EWrapper.h:8:
In file included from /home/bluethoughts/projects/QInteractiveBrokers-master/third_party/ib/IBJts/source/PosixClient/Shared/IBString.h:8:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/string:52:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/basic_string.h:2815:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/ext/string_conversions.h:43:
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/cstdio:120:11: error: no member named 'gets' in the global namespace
using ::gets;
~~^
In file included from /home/bluethoughts/projects/QInteractiveBrokers-master/src/IBClient.cpp:5:
/home/bluethoughts/projects/QInteractiveBrokers-master/third_party/ib/IBJts/source/PosixClient/Shared/EClientSocketBaseImpl.h:2807:14: warning: 56
enumeration values not handled in switch: 'BID_SIZE', 'ASK_SIZE', 'LAST_SIZE'... [-Wswitch]
switch( (TickType)tickTypeInt) {
^
1 warning and 1 error generated.
make[2]: *** [CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o] Error 1
make[1]: *** [CMakeFiles/qib.0.0.1.dir/all] Error 2
make: *** [all] Error 2-- The CXX compiler identification is GNU 4.8.5
-- The C compiler identification is GNU 4.8.5[bluethoughts@vm build]$ make
Scanning dependencies of target qib.0.0.1
[ 33%] Building CXX object CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o
In file included from /home/bluethoughts/projects/QInteractiveBrokers-master/src/IBClient.h:5:0,
from /home/bluethoughts/projects/QInteractiveBrokers-master/src/IBClient.cpp:1:
/home/bluethoughts/projects/QInteractiveBrokers-master/src/helpers.h: In function ‘auto partial(F&&, V&&)’:
/home/bluethoughts/projects/QInteractiveBrokers-master/src/helpers.h:40:60: error: expansion pattern ‘auto&&’ contains no argument packs
[f=std::forward(f), v=std::forward(v)](auto&&... args)
^
/home/bluethoughts/projects/QInteractiveBrokers-master/src/helpers.h: In lambda function:
/home/bluethoughts/projects/QInteractiveBrokers-master/src/helpers.h:42:30: error: ‘args’ was not declared in this scope
return f(v, decltype(args)(args)...);
^
make[2]: *** [CMakeFiles/qib.0.0.1.dir/src/IBClient.cpp.o] Error 1
make[1]: *** [CMakeFiles/qib.0.0.1.dir/all] Error 2
make: *** [all] Error 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.