# What's wrong with my Dev-C++?

## Recommended Posts

Ok, I started a new project in C. The default code is:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{

system("PAUSE");
return 0;
}

But it didn't compile! I got message "unable to run program file". Could anybody help me with this? Thanks!

##### Share on other sites
Is there another copy running? There is a menu item to kill it if it is, try doing that first. (I mean YOUR program, not DevC++ itself.)

No, there isn't!

##### Share on other sites
Try deleting all the generated makefiles, and rebuild all?

##### Share on other sites
I did so, but nothing changed. I can't understand it. Whatever program I did I know about that it worked suddenly doesn't work!
That's weird. Maybe I shoud reistall it...

##### Share on other sites
Is there any compiler output to post?

##### Share on other sites
There isn't any except for that I already mentioned. In a line column of compiler output is number 2. However this is output for all programs.

Compiler log:

Compiler: Default compiler
Building Makefile: "D:\Dev-Cpp\Projects\Makefile.win"
Executing make...
make.exe -f "D:\Dev-Cpp\Projects\Makefile.win" all
Execution terminated

##### Share on other sites
...
make.exe -f "D:\Dev-Cpp\Projects\Makefile.win" all
Execution terminated

hmm... if it's teriminated, then it didn't build, hmmm...

##### Share on other sites
Okay maybe this is a stupid question but....
Are you trying to write to a read only drive?

I accidentally left the write protection switch on on my key drive once then tried to compile something on it and got a similar warning.

##### Share on other sites
The only time that ever used to happen to me, was when a copy of the .exe I was trying to compile was still running, so it couldn't overwrite it.

##### Share on other sites
I've heard that installing it to a path that has spaces will cause that. An example is C:\Program Files\DevCpp. So installing it to C:\DevCpp should fix it.

Edit:
Hmmm, I just noticed that you have no spaces in where it's installed for you. So, what I said is useless. Unless, you remove the -? I doubt it though.

##### Share on other sites
acually I just had the same problem with the new version. Now you have to install it to a path with spaces!

##### Share on other sites
Quote:
 Original post by Ainokeaacually I just had the same problem with the new version. Now you have to install it to a path with spaces!

Forget what I said then. Had it completely backwards.

##### Share on other sites
Quote:
 Original post by j0seph#include #include int main(int argc, char *argv[]){ system("PAUSE"); return 0;}

try:

#include <stdio>
#include <stdlib>

int main(int argc, char *argv[])
{

system("PAUSE");
return 0;
}
[/code]
note the .h is missing

##### Share on other sites
see if the .exe file is still where it is supposed to be. If there is one, and you can't manually delete it, you may want to check ye olde Task Manager. If there isn't one, please disregard my entire existence.

##### Share on other sites
Quote:
Original post by K88soft
Quote:
 Original post by j0seph#include #include int main(int argc, char *argv[]){ system("PAUSE"); return 0;}

try:

#include <stdio>
#include <stdlib>

int main(int argc, char *argv[])
{

system("PAUSE");
return 0;
}
[/code]
note the .h is missing

That isn't matter! It's a C code and not C++. In C you have to use .h!

Ok, I've tried to delete makefiles, remove .exe, and any other built programs wasn't running. Well, thanks guys for your effort. I'll try to reinstall it and then I'll be wiser (maybe).

##### Share on other sites
I just tryed the code and it works fine. what Dev-C++ did you download? the 7MB one or the 2MB one?

If you downloaded the 2MB one then you dont have the compiler to compile the code so you need to download the 7MB one.

Also my Dev-C++ is located at C:\Dev-C++\ and its the latest version.

And also make sure you are saveing it a .c and not .cpp