• 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
<types.h> and other includes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

<types.h> and other includes


  • Subject: <types.h> and other includes
  • From: Markian Hlynka <email@hidden>
  • Date: Tue, 22 Feb 2005 18:21:41 -0700



Ok, so, I have a project that compiles fine in xcode. I usually have this project compiling under various unices as well. Today, I tested the linux compile. I should add that I _also make sure this stuff compiles on the MacOS command line using make. So, once I'd changed Makefile to makefile, and other silliness, two things bothered me after moving to linux:

Starting with the lesser...

1. I had to add #include <stdlib.h> to a file when using the makefile, because it didn't know what exit() was. Why didn't xcode have a problem with this? If xcode has a bunch of automatic includes, is it feasible to disable them so I get the same errors for inclusion as I would when running make? And, if this was an xcode thing, why didn't gcc/make on OS X have trouble with this?

2. I used a type, u_int16_t. Neither xcode nor gcc/make on OS X required me to do anything. however, on linux I had to #include <sys/types.h> Why?

More annoyingly, I wanted to make sure that if I had included <sys/types.h> in the mac code, it would still work. Well, first I went to xcode and command-clicked u_int16_t so see the definition. It too me to /usr/include/ppc/types.h. Upon routing around I ALSO discovered types.h files in /usr/include/sys/ and /usr/include/machine/

I'm not sure if I diffed every combination, but they are NOT all the same. What's going on here? by included sys/types.h have I overridden the /ppc/types.h? added to it?

And, more importantly, again, what's the deal? I want my OS X compiles, whether with xcode or makefile, to require me to include the same things as much as possible as linux will. I realize that for some things this isn't going to be possible. However, I'm writing pretty straight-up un-fancy code here.

Can anyone explain what's happening or propose suggestions?

Thanks,

Markian

_______________________________________________
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: <types.h> and other includes
      • From: Alastair Houghton <email@hidden>
    • Re: <types.h> and other includes
      • From: David Leimbach <email@hidden>
  • Prev by Date: .h file not found? XCode 1.5
  • Next by Date: Re: How do I suppress the warning about 'statement with no effect'
  • Previous by thread: .h file not found? XCode 1.5
  • Next by thread: Re: <types.h> and other includes
  • Index(es):
    • Date
    • Thread