swigibpy
swigibpy copied to clipboard
Need to add winsock header on Cygwin
Must add sys/socket.h to make swigibpy work on Cygwin. Without it setup.py fails:
IB/src/EPosixClientSocket.cpp: In member function ‘virtual bool EPosixClientSocket::eConnect(const char*, unsigned int, int, bool)’:
IB/src/EPosixClientSocket.cpp:43:39: error: ‘socket’ was not declared in this scope
m_fd = socket(AF_INET, SOCK_STREAM, 0);
^
IB/src/EPosixClientSocket.cpp:66:58: error: ‘connect’ was not declared in this scope
if( (connect( m_fd, (struct sockaddr *) &sa, sizeof( sa))) < 0) {
^
IB/src/EPosixClientSocket.cpp: In member function ‘virtual int EPosixClientSocket::send(const char*, size_t)’:
IB/src/EPosixClientSocket.cpp:130:16: error: ‘::send’ has not been declared
int nResult = ::send( m_fd, buf, sz, 0);
^
IB/src/EPosixClientSocket.cpp: In member function ‘virtual int EPosixClientSocket::receive(char*, size_t)’:
IB/src/EPosixClientSocket.cpp:146:16: error: ‘::recv’ has not been declared
int nResult = ::recv( m_fd, buf, sz, 0);
^
error: command 'gcc' failed with exit status 1
Much appreciated. Thanks! Seeing as this affects TWS API code I'll turn it into one of swigibpy's patches rather than merging it directly.
Oh good call! Should have figured out that using patches was the proper way to do it.
whoops - didn't realize the standard is to check in with patches applied. reapplying patch.