C ++ / Xcode Sockets bind () error

When trying to process the return value (must be int) from sys / sockets.h bind (), Xcode does not compile with an error

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

It seems that you are trying to determine the wrong function definition for bind (), because when I select the "context menu" in "Go to definition", it gives me three options: 2 definitions from functional.cpp function and 1 from sys / socket .hour. I have sys / sockets included in my code, how do I get the compiler to use the correct definition?

+6
source share
1 answer

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

+19
source

Source: https://habr.com/ru/post/943486/


All Articles