[comp.sys.mac.programmer] Stealth Think C header file attack?

jsaker@zeus.unomaha.edu (Jamie Saker) (02/09/91)

I've just begun working out of Mark and Reed's "Macintosh Programming
Primer" (Volume 1) and as soon as I hit the first assignment using
Think C (version 4), I've run into a problem with stealth header files.

When I go to add the stdio.h header file, Think C cannot see it inside
it's folder.  We're running it off of an AppleShare server (SE/30) and I'm on
a SE (w/ 2 1/2 MB RAM).  The files are visible at the desktop
level, but when it comes to including -any- header file, they
are not visible.  However, any *.c file /is/ visible.

Just for fun, I pulled Think C down to my hard drive off of the server
to see if that was the problem.  Still no change: headers/  folder
appears to be empty.

I noticed that version 4 is copyrighted in 1989, same year as the release
of Macintosh Programming Primer. Could this be a version change? Or
am I doing something quite stupid?

Many many thanks in advance from a Mac-Programmer-wanna-be :-)


|    Jamie Saker     jsaker@zeus.unomaha.edu   Public Relations Director     |||
||   C&DC Consultant jsaker@orion.unomaha.edu  UNO Student Chapter of the     ||
|||  Univ.Nebr@Omaha JSAKER@UNOMA1 (bitnet)    Assoc. for Computing Machinery  |

hawley@adobe.COM (Steve Hawley) (02/12/91)

In article <7832.27b32be5@zeus.unomaha.edu> jsaker@zeus.unomaha.edu (Jamie Saker) writes:
>When I go to add the stdio.h header file, Think C cannot see it inside
>it's folder.  We're running it off of an AppleShare server (SE/30) and I'm on
>a SE (w/ 2 1/2 MB RAM).  The files are visible at the desktop
>level, but when it comes to including -any- header file, they
>are not visible.  However, any *.c file /is/ visible.

It sounds to me like you are trying to use the "Add..." selection in the
Project menu to add files to your project.  You cannot add .h files, since they
are not C source (technically).  If you want a C file to include a .h file,
then use #include <file> or #include "file" as is dictated by the location of
the file.  If you want the files transparently included in all your files,
see the section in yout Think C manual on precompiled headers.

Steve Hawley
hawley@adobe.com
-- 
"Did you know that a cow was *MURDERED* to make that jacket?"
"Yes.    I didn't think there were any witnesses, so I guess I'll have to kill
 you too." -Jake Johansen

231b3679@fergvax.unl.edu (Mike Gleason) (02/12/91)

The trick is that you don't add the headers to your project file.  You simply
put the #include statments in your .c code, which you do add. Make sure that
your custom headers are some place where ThC can find them, like in the
same folder as your project file.  If you #include "stdio.h", ThC should find
it OK because it should be in Think C's folder tree.

_mike