Probably has something to do with the system("PAUSE"); call. AFAIK, this is not portable and may not work on your system. I would recommend just replacing it with a cin.get() and press return to continue the program as is recommended on this page:
Well, if it is not the PAUSE being undefined, then it is probably your environment is not set up properly in some manner. I work on Linux and am currently using a mac at home so I can't offer any advice for windows stuff. The only environment I have used on windows is cygwin, without any ide. On my mac, your above code compiles and links fine with g++, but issues an error at runtime for the PAUSE command.
[Linker error] undefined reference to `__dyn_tls_init_callback'
[Linker error] undefined reference to `__cpu_features_init'
> Dev-C++ is horribly outdated, so you should not use it.
It looks like Dev-C++ 5 contains GCC 3.4.2. My mac with OS 10.5.8 seems to have 4.0.1 and the newest release looks like it is 4.5. I am just curious; does Code::Blocks/MinGW install bring it up to what comes with 5.0, ore something newer?
problem solved. I uninstalled Dev C++ completely. I used system restore to roll back my computer from when I first started using DEV C++ which was two weeks ago. Reinstalled Dev C++ and (for now) the above program (hello world) is working.
I encountered this problem when I had another mingw installed at c:\mingw and it was a newer version of the compiler than that bundled with Dev C++. (The version bundled with Dev C++ is 3.4.2...the current version is 4.5.0).
There are two ways to fix this problem.
1. update the compiler used by Dev C++, this is probably not an appropriate approach for a beginner though it's not hard to do
2. remove the installation of mingw and reinstall it elsewhere (e.g., c:\mingw4.5), this is an easy fix but don't forget to update your path variable to reflect the new directory (c:\mingw4.5\MinGW\bin)