Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Beginner needs to compile a simple program in Think C.

61 views
Skip to first unread message

Greg Vaughn

unread,
Dec 14, 1994, 1:48:04 AM12/14/94
to
In article <D0t4v...@world.std.com>, cr...@world.std.com (David Crump) wrote:

>I recently found a copy of Think C on my brother's old Mac and
>have started using it. The problem is, there is no documentation!

See more below, but you really ought to try to hunt down the manuals. If
there aren't any then it is probably pirated. You could probably find
someone willing to sell a used version with manuals of TC 5.x for $50 or
less. The headaches you will save by having the manuals is well worth the
money.
>
> 1. Is Think C just for developing Mac applications?

Well...basically it is. However it is ANSI compliant so you should be able
to run ANSI code. Though you will get a "console window" interface rather
than the usual windowing/menus interface of a Mac program. It takes some
work on your part to make it into a "true" Mac-like program.
>
> 2. If not, how can I compile this simple program:
>
>#inculde <stdio.h>
>main()
>{
> printf("Print this string...\n");
>}
>
>
> I thought I had the ANSI library open, but I know I am
>missing a step. It gives me an error when I compile saying "Can not
>find the file "stdio.h"
> What are the steps to straight forward compiling for a
>beginner using Think C?

That code looks like It should compile. One thing that is different on TC
than the Unix compiler you were using is the project file. You can think
of it as an interactive makefile (sort of). Your project file will need to
have the ANSI library in it to write ANSI code. It can't find your header,
hmm.... Another thing about TC is that there are special places to put
certain files. In the same folder as the Think Project Manager should be a
folder called "Standard Libraries" that contains the ANSI libraries and
their header files. The brackets around <stdio.h> tell the compiler to
look in the usual place for the file. You could alternatively move the
file to the same directory as your source file and put quotations around
it (like "stdio.h").

There are lots of potential "gotchas" when using Think C. Especially if
you are unsure things are set up right in the first place. Without manuals
or previous experience with it, you are in for some headaches and help
from the net will only go so far.

______ | Greg Vaughn G.Va...@ttu.edu
/\__ _\ | Physics Doctoral Candidate
\/_/\ \/ exas | Insulator Research Lab
\ \_\ ech University | Finger: gr...@scm41-2.phys.ttu.edu
\/_/ Lubbock, Texas | Alt. E-mail: ri...@ttacs.ttu.edu

David Crump

unread,
Dec 14, 1994, 10:40:15 AM12/14/94
to
I recently found a copy of Think C on my brother's old Mac and
have started using it. The problem is, there is no documentation!

I have recently started to learn C on my own, and have compiled
some simple programs on the public access Unix machine I log into,
but I thought I would try it with Think C. The problem is, I am
not familiar with the program and am having trouble compiling a
very simple program.

1. Is Think C just for developing Mac applications?

2. If not, how can I compile this simple program:

#inculde <stdio.h>
main()
{
printf("Print this string...\n");
}


I thought I had the ANSI library open, but I know I am
missing a step. It gives me an error when I compile saying "Can not
find the file "stdio.h"
What are the steps to straight forward compiling for a
beginner using Think C?

Thank you...

David Crump
cr...@world.std.com

===================

Ken Long

unread,
Dec 14, 1994, 1:59:27 PM12/14/94
to
David Crump (cr...@world.std.com) wrote:

: #inculde <stdio.h>


: main()
: {
: printf("Print this string...\n");
: }
: I thought I had the ANSI library open, but I know I am
: missing a step. It gives me an error when I compile saying "Can not
: find the file "stdio.h"

The file stdio.h has to be in the same (or deeper) folder as your Think C
application. The '<' and '>' tell Think C to look for it "at home". If
you had said: #include "stdio.h" then Think C would look for it in in
your projects folder (or deeper) AND at home. Anywhere else and it's
lost. Sort of like a driver's licence with work/home restrictions.

: What are the steps to straight forward compiling for a
: beginner using Think C?

Dog your brother to find the manual. What version of Think C is it?

Most of the tips you'll find on the net won't cover operation of the
Think C program but, rather, programming once you're using it. Your only
option is trial and error, without a manual. Since the information on
how to use the program is already written, no one would likely be willing
to write highlights of it and send it to you.

Maybe Symantec would sell you a manual if you can't find one?

-Ken-

0 new messages