12

When trying to process the return value (should be int) from sys/sockets.h bind(), Xcode fails to compile with the error

Invalid operands to binary expression ('__bind' and 'int')

It seems to be pulling the incorrect function definition for bind(), because when I choose "Jump to definition" from the contextual menu, it gives me three options: 2 definitions from functional.cpp, and 1 from sys/sockets.h. I have sys/sockets included in my code, how to I force the compiler to use the correct definition?

Calteran
  • 1,063
  • 8
  • 12

1 Answers1

31

Use ::bind or get rid of the using namespace std;.

Jesse Good
  • 50,901
  • 14
  • 124
  • 166