Can't compile anything with Dev-C++ on Vista

I use Windows Vista Home Premium and Dev-C++ 4.9.9.2, and I cannot compile even the simplest of programs.

Source code:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
printf("hello world\n");
system("pause");
return 0;
}

Compile log:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
C:\Dev-Cpp\bin\make.exe -f "C:\Dev-Cpp\Makefile.win" all
C:\Dev-Cpp\bin\gcc.exe -c main.c -o main.o -I"C:/Dev-Cpp/include"

gcc.exe: main.c: No such file or directory
gcc.exe: no input files

C:\Dev-Cpp\bin\make.exe: *** [main.o] Error 1

Execution terminated

It's like Dev-C++ insists that my file doesn't exist when it really is there. I am running Dev-C++ as Administrator.
I'm a begiinner with C++ and run on Vista. Initially, I had compiler problems but not with Dev C++. I'm presently running this version and compile programs.

Based on my experience, one thing I noticed is you appear to be using code from C and not C++. A couple of suggestions:

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;

int main(){
cout<<"hello world"<<endl;
system("pause");
return 0;
}

The "using namespace.std;" allows you to simply say cout or cin without having to say std::cout or std::cin to show input or output lines. Also, you have to use the "#include <iostream> library for input/output functions.

Try this code above and see if your results change. If not, you may want to reinstlall your compiler.
Last edited on
Topic archived. No new replies allowed.