MinGW (Minimalist GNU for Windows) is actually a whole collection of GNU programs (not just a compiler) that have been ported to Windows and it does include a version of GCC (GNU Compiler Collection) that works on Windows, creating binaries for that platform. It is natural for both Dev C++ and Code::Blocks to use MinGW on Windows. While GCC in latest MinGW is either same version as on other platforms or close, the version of MinGW installed by the ancient Dev C++ is really ancient and deprecated by todays standards.
hey thats what im running! well, my windows partition anyways... what compiler are you using? gcc or g++? also, are you sure the R"(Hello world!)"; is correct? i think it needs to be R("Hello world!"); although, you dont have a function R defined. what tutorial are you using?
Ok, I looked and when I saved it the file type said "C\C++" so I assumed that is was saving it as the correct type. Apparently not, when I looked at the file properties there was only a ".c" after the file name, so I did a SaveAs, selected "All Files *.*", and manually typed in ".cpp". Now when I build and run I do not get the fatal error message... now it just doesn't like the "x" as a variable.
Ok, got the "x" issue fixed... didn't know that I had to go into the compiler settings each time to check the box "Have g++ follow the C++11 ISO C++ language standard [-std=c++11]". got that checked and hit run... boxed popped up, but it took about 10-12 seconds for the actual "Hello World" to to show up. Is that normal?
@Little Bobby Tables
That is valid. Search 'Raw String Literal' for more details.
Its possible that your computer is just sluggish. <iostream> is a massive library, and it also needs to open the console window (a more difficult task than it sounds) as well as dynamically load in the runtime library and standard library, unless you compiled it statically.
Are you running it from within Code::Blocks? Running it from outside of Code::Blocks can be slightly faster load time, because Code::Blocks has its own wrapper program over the top of yours to pause the program when its done.
On a side note, if you go to Settings->Compiler... you can make it so that all your future compilations with a specific compiler (in this case, GCC) will use the C++11 standard (rather than the default of gnu98, which is C++98 with some GNU extensions).
Yes I was running it from inside C::B... So I went and found the "application" and double clicked it... it flashed up on the screen and faded away almost instantly. Should it do that? (I"m thinking not)
@Little Bobby Tables
Basically. Its mostly used in regexes, because escaping all those backslashes otherwise becomes a pain.
Are you running Windows or a Linux machine? On Linux, run it from the terminal. On Windows, go to Start->Run, type 'cmd' and then navigate to it from there (use cd to change directory, just type the name of the application to run). Alternately, on recent versions of windows, drawing the application into the cmd window from explorer allows you to just press <ENTER> and run it.
When you manually run the program outside of Code Blocks as is, it will almost instantly close because nothing is specifying it to stay open. There's quite a few ways that you can keep this from happening. Most people just add system("PAUSE"); just before return 0; in their main function when starting out. I wouldn't recommend this. Alternatively, you can do this:
1 2 3 4 5 6 7 8 9 10 11
cout<<"Press enter/return to close the program."<<endl;
This is probably the simplest way to do this without using system("PAUSE");. It works by causing the program to essentially wait for further input before closing. By the way, the second cout statement is completely optional. I recommend it so the user knows what to do when they get that far.