• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem with #include <unistd.h> - 'close' was not declared in this scope
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with #include <unistd.h> - 'close' was not declared in this scope


  • Subject: Problem with #include <unistd.h> - 'close' was not declared in this scope
  • From: "Tom O'Grady" <email@hidden>
  • Date: Mon, 19 Nov 2007 16:03:17 -0000

Hi there,
I have a problem which I'd be very grateful for some help with...
  
I'm trying to use the 'close' function used for file descriptors etc, but even when I have the line '#include <unistd.h>', I get the message:
 
'close' was not declared in this scope.
 
The Xcode project includes some code involving sockets. The list of included headers is as follows:
 
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types/h>
#include <sys/uio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa.inet.h>
 
The calls to 'socket', 'recv' etc compile fine - it's just the problem with 'close'.
My SDKROOT variable is set to /Developer/SDKs/MacOSX10.4u.sdk/
I tried linking to an editable copy of the 10.4u SDK I'd placed on my Desktop, and by adding lines to cause errors, it seems that when interpreting the line:
 
#include <unistd.h>
 
my Xcode project includes the file '$(SDKROOT)/usr/include/usr/unistd.h'
 
instead of the one where 'close' is defined which I need: $(SDKROOT)/usr/include/unistd.h' (which includes the one above anyway).
 
I don't have any special header search paths relating to the SDK - only paths to our own code.
A temporary measure is to substitute the line:
 
'#include "usr/include/unistd.h" '
 
since this removes the error, but this is probably the wrong way to go about it, since it just sweeps the problem under the carpet...
 
 
Could anybody suggest what I need to do to solve this?
 
Thanks,
Tom
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Problem with #include <unistd.h> - 'close' was not declared in this scope
      • From: "Justin C. Walker" <email@hidden>
  • Prev by Date: Re: Command line "Hello World" not showing
  • Next by Date: How to disable a window in carbon
  • Previous by thread: Re: Command line "Hello World" not showing
  • Next by thread: Re: Problem with #include <unistd.h> - 'close' was not declared in this scope
  • Index(es):
    • Date
    • Thread