If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

C compilers and standards help

Hello: I have always programmed in C for windows using either Turbo C or Borland C++.
Recently I am trying to dive into the Mac OSX/Unix world. I am learning how to use the gcc compiler in mac os x panther. The help files in apple's developer pages are not very concise, I have tried to look around for a very basic tutorial on gcc but no luck. Could anyone point me to a basic tutorial in this matter?

I also would like to ask if anyone can explain to me what libraries, standards and functions are compatible with which compilers? For example:

This works perfectly under windows when I use my Borland compiler. In mac os x I have tried to compile it:
$c++ hello.c
and it gives me a series of errors saying that it can't find conio.h and stuff like that.
Where does mac os x store the .h files for C?

My understanding of compliers is a little dusty, MSMittens, Tedob 1 and others, are more knowledgeable with gcc questions than I am. Hopefully one of the Senior folks will jump in before I mislead you.....lol

But I was interested to say the least. So I took a look at my software and it supports the following”C” Headers:

Note:
- There are other C Reference pages on the Net, but being the Standard C, that's my favorite.
- "C Standard" here corresponds to ANSI X3.159-1989 or ISO/IEC 9899:1990.
- As you can read yourself, (1) conio.h is not the standard C header file, (2) you only need to include stdio.h, and (3) you need getchar() not getch().

Peace always,&lt;jdenny&gt;

Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert HeinleinI\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds

Compile it by typing in the shell: $c++ hello.cpp
I get no errors.
The I run It: $./hello.cpp
I get two errors:
./hello.cpp: line 2: syntax error near unexpected token `('
./hello.cpp: line 2: `int main()'

Note:
Borland C and Turbo C DO have the command line version of C/C++ compiler (bcc/bcc32 for Borland C and tcc for Turbo C). You can compile your program like this:

D:\&gt; bcc32 hello.cpp

This will save the compiled executable as hello.exe in current dir
Then run the executable like this:

D:\&gt; hello

So I guess it's not a Windows vs MacOSX problem, but rather a GUI vs CLI "problem".

Peace always,&lt;jdenny&gt;

Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert HeinleinI\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds