swigibpy icon indicating copy to clipboard operation
swigibpy copied to clipboard

Need to add winsock header on Cygwin

Open thorrr opened this issue 9 years ago • 3 comments

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

thorrr avatar Jan 30 '16 02:01 thorrr

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.

Komnomnomnom avatar Jan 30 '16 17:01 Komnomnomnom

Oh good call! Should have figured out that using patches was the proper way to do it.

thorrr avatar Jan 30 '16 20:01 thorrr

whoops - didn't realize the standard is to check in with patches applied. reapplying patch.

thorrr avatar Apr 26 '16 01:04 thorrr