problem

Started by
5 comments, last by aleandro 18 years, 10 months ago
Ok so picked up this book "the absolute beginer's guide to C" I tried to do what was in the book but there is a problem. I am using Dev C++ So i wrote it just like in the book( the second letter grade should be "a class average" but i doubt its the issue), and I tried to compile and it did and I have the file, but a message says that there is one error. But when I try to debug it says that the file dos not exist when it is right there in the folder. Image Hosted by ImageShack.us Image Hosted by ImageShack.us Image Hosted by ImageShack.us
Advertisement
Your problem is that you're doing #include <studio.h> instead of #include <stdio.h> (no "u").

The Untitled1.exe files does not exist. The file you see is Untitled1.c. Untitled1.exe does not exist because the compile failed (because there was an error). Debugging is used for run-time errors, not compile-time errors.
Ra
#include <studio.h>
should be

#include <stdio.h>
.

stdio, not studio.

That'll make it compile and run.

EDIT: Bah, beaten!
You have a compil time error - not a runtime error. For instance, the file studio.h don't exist (read the error message. It contains useful hint about the error itself).

Your code should be corrected to

#include <stdio.h>int main(){  /* your 3 printf statements goes here */  return 0:}


It there is a compil time error, the executable file is not generated, and thus you can't run it (this is the explaination of the second error). A C file is not an executable file, it is a text file that have to be compiled without error to become a exe file.

This kind of information should be in your book introduction. If it is not, then it is not a good book for a beginner.

Another thing: please, don't post screenshot to show a problem. Post code, post the error messages themselves (try to show only the pertinent information) but hell! Images! :)

HTH,
Well I don't know why the compiler doesn't know were the header file is stdio.h
But in dev you can see what directory dev looks trough at tools->compiler options

Regarding the debugger problem...there is no .exe file in your folder, the file you point at is a .c file. You have to compile before a .exe file is made...

[edit]Three people before me answering =) I must be slow :D [/edit]

//walle
Oh, and I might add you're using an oldish version of Dev C++ there. There's version 4.9.9.2, available from here.

It's worth considering for when you get to more advanced projects, it never hurts to have the latest version :)
Oh thank you guys.

This topic is closed to new replies.

Advertisement