 |
 |
what is wrong with thoes INCLUDE?
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Aug 2004
Status:
Offline
|
|
#include <stdio.h>
#include <iostream.h>
#include <stdlib.h>
this is the head of code i got form the lecture, and can not run on mac, why?
As my teacher using VS6.0, so what is the diff between using xcode and VS6.0, as i thought i just use C
|
|
There were once four people named Everybody, Somebody, Nobody and Anybody. Somebody had to do a job, but Nobody wanted to do it. Nobody could see that Anybody could do it, and Somebody got angry about that because it was Everybody's job. Nobody ended up doing it, and it so happened that Everybody blamed Somebody when Nobody did what Anybody could have done.
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Dec 2004
Status:
Offline
|
|
Originally posted by maCCer:
#include <stdio.h>
#include <iostream.h>
#include <stdlib.h>
this is the head of code i got form the lecture, and can not run on mac, why?
As my teacher using VS6.0, so what is the diff between using xcode and VS6.0, as i thought i just use C
Show us the error the compiler is giving you, and we may be able to guess. Odds are pretty good that you are trying to compile with a C compiler, instead of C++, in which case, iostream.h isn't an accessible .h file, since it is a C++ file.
If I compile a file called test.c with those includes and compile with gcc, I get:
gcc test.c
test.c:2:22: iostream.h: No such file or directory
If I compile the exact same file with g++, it compiles quite happily.
Try changing the name to a cplusplus suffix (like cpp) which a C compiler should recognize as needing to be compiled as cplusplus.
--sam
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Aug 2004
Status:
Offline
|
|
Originally posted by ideasculptor:
Show us the error the compiler is giving you, and we may be able to guess. Odds are pretty good that you are trying to compile with a C compiler, instead of C++, in which case, iostream.h isn't an accessible .h file, since it is a C++ file.
If I compile a file called test.c with those includes and compile with gcc, I get:
If I compile the exact same file with g++, it compiles quite happily.
Try changing the name to a cplusplus suffix (like cpp) which a C compiler should recognize as needing to be compiled as cplusplus.
--sam
thx, i got the wrong compiler, stupid myself 
|
|
There were once four people named Everybody, Somebody, Nobody and Anybody. Somebody had to do a job, but Nobody wanted to do it. Nobody could see that Anybody could do it, and Somebody got angry about that because it was Everybody's job. Nobody ended up doing it, and it so happened that Everybody blamed Somebody when Nobody did what Anybody could have done.
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|