Setting Up A C++ IDE 07-24-2013, 09:17 AM
#1
Hello, Code Community Members!
The fact that you clicked on this thread shows that you probably want to learn how to set up a c++ IDE, or maybe you're just curious.
Well, either way, keep on reading if you want to know how!
First of all.
What is an IDE, Xiledcore?
You might think that this is a dumb question, but trust me, it's not! We all asked ourselves the same question at some point.
IDE stands for Integrated Development Environment. It's basically a tool for programmers that gathers the compiler, linker, editor and debugger into one place to make it easier to develop applications.
Okay, now how do i get one, smarty?
Yes, that's really easy. There are various different free C++ IDE, but in my tutorials later on, I'll be using Dev C++ so I'll only show you how to get that one.
First, go on http://www.bloodshed.net/
And then click on downloads.
![[Image: 5tM0elwh.png]](http://i.imgur.com/5tM0elwh.png)
![[Image: IJmZXbRh.png]](http://i.imgur.com/IJmZXbRh.png)
![[Image: U2MgX6wh.png]](http://i.imgur.com/U2MgX6wh.png)
Note: Downloading the latest version isn't always the wisest decision, but for now, we'll do so.
Now scroll down the page until you see:
![[Image: fCaHSoHh.png]](http://i.imgur.com/fCaHSoHh.png)
Now your download will begin shortly. After it's been downloaded, you just go through the installation and run the program. Now, let's just create a simple program to test if it works.
![[Image: 0qm4MUT.png]](http://i.imgur.com/0qm4MUT.png)
![[Image: MrJHLuG.png]](http://i.imgur.com/MrJHLuG.png)
Now, type in this:
Code:
#include <iostream> //Includes the iostream library for input and output commands
#include <string> //Includes the string library
using namespace std; //Prevents us from typing std::string or std::cout all the time. However, in larger applications, using this wouldn't be very efficient.
void tutorial() //A simple function
{
string tut("Was this tutorial any good?"); //String variable
string tut2("Please tell me what you think by commenting on the thread :)"); //Another string variable
cout << tut << endl << tut2 << endl; //Prints those two string variables onto the console
}
int main() //The Main Function
{
tutorial(); //Calls the function
return 0;
}And you'll get this:
![[Image: 8Va8Z6m.png]](http://i.imgur.com/8Va8Z6m.png)
That's basically it! Any questions, please post them in this thread and I'll do my utmost to answer them all.
(Yes, I used paint to do the pictures and please excuse me for my terrible censoring skills, and not to mention graphic skills all together).
Useful information:
Spoiler:
(07-25-2013, 11:48 PM)0xDEADPIXEL Wrote: If you don't mind, I would like to point out some mistakes in your tutorial and some suggestion which in my opinion provide a better learning journey and use of C++.
(07-24-2013, 09:17 AM)Xiledcore Wrote: There are various different free C++ compilers, but in my tutorials later on, I'll be using Dev C++ so I'll only show you how to get that one.
First of all, Dev-C++ is not a compiler, but an IDE. On one of the pictures it says that Dev-C++ comes with a full Mingw compiler system. If you plan to use the Dev-C++ IDE you should use the more modern and maintained version, which is Orwell Dev-C++. It features a more modern version of the compiler (it's not the latest one, but it supports some C++ 11 features), but clearly a lot better than the deprecated version which comes with the regular Dev-C++ IDE.
(07-24-2013, 09:17 AM)Xiledcore Wrote: Now, type in this:
Code:#include <iostream> //Includes the iostream library for input and output commands #include <string> //Includes the string library using namespace std; //Prevents us from typing std::string or std::cout all the time void tutorial() //A simple function { string tut("Was this tutorial any good?"); //String variable string tut2("Please tell me what you think by commenting on the thread :)"); //Another string variable cout << tut << endl << tut2 << endl; //Prints those two string variables onto the console } int main() //The Main Function { tutorial(); //Calls the function system("PAUSE"); return 0; }
Omitting the "using namespace std;" line is actually better practice and is endorsed by the C++ standard, but this works too and when building big programs you may get errors if you name a function with the same name as one from the included namespace.
Pausing the console application from closing with "system("PAUSE");" is considered bad practice among C++ programmers, one of the reasons for that is because it isn't portable, meaning you can only use it on Windows, it won't work on Linux, OS X and etc. Take a look at here for more reasons why not to use "system("PAUSE");"
Also, here you can read more about alternative methods of pausing the console application so you can read the output.
I would also like to add a suggestion about the compiler, if you are a Windows user, go with GCC or MSVC. Here's a link to a custom MinGW distribution featuring the latest GCC version which is C++ feature-complete. I use this one when I compile code on Windows.
Hope I wasn't too long
![[Image: WV5eQ42.jpg]](http://i.imgur.com/WV5eQ42.jpg)
If you've got any questions regarding c++ or java, feel free to hit me up with a private message at any time.
http://adf.ly/UyTEk

![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)

![[Image: tumblr_m4vms28lYu1qj3ir1.gif]](http://media.tumblr.com/tumblr_m4vms28lYu1qj3ir1.gif)
![[Image: dCNByK5.png]](http://i.imgur.com/dCNByK5.png)

![[Image: coolsignature.gif]](http://www.zosoftnet.com/coolsignature.gif)
