iDevGames Forums

Full Version: Where in the world is ::close ( socket/fd ) defined ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On the iPhone SDK, Which framework should I include in order to include a header that declares the ::close ?

(I need to close function to close a TCP socket.)

Ive tried the following but the compiler complains that close is not declared Annoyed
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <netinet/in.h>
#include <netdb.h>
void test() {
::close( 0 );

Any clues to what im missing here ? Huh
It's in unistd.h. However, I don't see an #ifdef __cplusplus extern "C" { #endif in that file, so you may need to wrap the #include in one yourself if you really need to include it from C++ code.
Reference URL's