Dev c++ compiler will compile but not run

Normally I use visual studio but recently found a tutorial I want to try that uses the Dev compiler. So I download from bloodshed and set up the hello world program and when I click "compile and run" the compile box pops up and compiles without error but afterwards the program window doesnt come up, as if it didnt even run. Im sure its not the common problem where it runs so fast you barely see it, I tried the "cin.get();" trick but absolutely no program window appears. Any ideas?
I went here to get the download and I chose the first one: http://www.bloodshed.net/devcpp.html
Last edited on
You're probably missing the compiler. Obviously you won't get an error if you have nothing to send the program an error.

On a side note: http://cplusplus.com/articles/36vU7k9E/
Thanks. Being new to programming in general I assume c++ is the same language no matter what compiler so Im going to try and follow along with the tutorial but use visual studio instead.
at a shallow level, yes. however the deeper into the language/os/system the code becomes less portable
I think you're confusing an IDE with a compiler. The program most beginners use is called an IDE, for example, Code::Blocks, Visual C++, Bloodshed Dev-C++, etc. A compiler is what physically takes your code and turns it into an executable. The most common compilers are g++ and vc++. Visual C++ is typically coupled with it's compiler and most freeware/opensource IDE's have an option that include a MingW version of g++ coupled with it. You need to either download a separate compiler, I suggest the MingW executable if you have no idea what you're doing, or you need to download a package that already includes a compiler.

The IDE itself doesn't affect what kind of program is generated. A lot of IDE's, however, will come with their own templates for what kind of programs it recognizes. You're also not required to use just those templates either. Whatever tutorial you used can equally be applied to other IDE's. The only difference might be the buttons you click to compile, the amount of code completion the IDE offers in regards, and also the compiler the tutorial used might be out dated and the code in general may no longer be invalid.

If you downloaded Dev-C++ 5.0 beta 9.2 (4.9.9.2) (9.0 MB) with Mingw/GCC 3.4.2, then you should have had a compiler with it. However, if you downloaded the executable only, you are missing the compiler. I haven't used Dev-C++ in about 7 years since I stopped using it in high school.

If you are sure you have a compiler, try this code:
1
2
3
4
5
6
7
8
#include <iostream>

int main() {
   std::cout << "Hello, World!";
   std::cin.ignore();

   return 0;
}


That should display "Hello, World!" on the console and wait for a button to be pressed.

1
2
3
4
5
int main() {
   std::consoleout << 10; // Should cause an error

   return 0;
}


If you try the above, it shouldn't compile and you should get an error. If neither of the above code snippets do anything for you, you're missing the compiler.
no visual studios made a c++ compiler called visual studios
Topic archived. No new replies allowed.