accept() function missing? WTF?

I'm writing my code on mac OS X. I added the following headers:

#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

I'm trying to write a simple TCP client/server, but this is stopping me.

I'm using xcode, but it's just an empty project. I define my own make file and everything, I just use xcode for editing the source code text.

No matter what I do, I get "no matching function for accept()".

What's going on? .....
Those socket functions you need are in sys/socket.h.

You can always search for them yourself. Get a terminal and type:
grep -r accept\( /usr/include/*


If you're not familiar with the terminal, it's about time you started.
"If you're not familiar with the terminal, it's about time you started. " Lol.

"You can always search for them yourself." Woops, I forgot to mention I already looked at socket.h. The declaration is there. Yet when I compile, for some reason accept() is not found. Perhaps xcode is finding them but when I compile it still can't find them, perhaps it can't find the /usr/include/*. Does this make sense?
My Xcode has stopped working. I'll get back to you when I've reinstalled it.
I define my own make file and everything


Sorry ignore my old post - didn't see this.

Do you not think this has something to do with it? Have you tried running make from the command line to debug your Makefile?

What special stuff do you need in your Makefile that stops you from using a standard Xcode project - as this is surely better?
Last edited on
Topic archived. No new replies allowed.