Some clarification needed...

I'm learning c++ to become a games programmer but I don't understand how Compilers or IDE's work. What I think I know is this:

IDE's are to coding what Word is to writing. They allow for editing and use of presets when coding.

Compilers convert lines of code into an executable file, also converting them into a more generic language to maximise compatability.

If I'm correct can someone recommend an IDE and Compiler, preferrably one with an explanation for beginners. If not, can you explain what these are and if applicable ditto on the recommendation.
The analogy to MS Word is correct.

Your understanding of compilers is also pretty much OK. It all depends on what you mean by "compatibility". The compiler translate lines of code into machine language according to the PE format (portable executable), at least in MS Windows. Not sure if this is true in other OS'es.

I am always SUPER happy with MS Visual Studio, but I think it doesn't have an introductory tutorial. But you can find TONS of tutorials if you Bing/Google for them.
Thank you, I'd like to know which compiler was used for the PDF tutorial on this site, as my Visual studio uses namespace standard instead of std and i really don't get what the difference is.

Edit: Can I just code in Notepad and then compile it afterwards??
Last edited on
Dunno which compiler was used in this site's tutorial.

I don't know what you mean about the standard namespaces. The Visual C++ header files have the same classes named the same as you find them in other compilers.

Yes, you can code in Notepad and then use a compiler to compile. But why do that when an IDE is sooo rich?
The tutorial has you make the classic Hello World program, with the lines
#include <iostream>
using namespace std;

int main ()
{cout << "Hello World!";
}
return 0;

while when I opened Visual C++ express it had these lines already present:

#include <something that wasn't iostream>
using namespace Standard;
etc...

Why are the compiler related lines of code different is what I am asking.
BUMP!
Try using Netbeans or Eclipse. Visual c++ uses the .net framework because it makes your code compatible across all versions of windows running the framework. You should be able to delete the generated lines and still use the tutorial from the pdf as long as it doesn't make system calls or include header files that are related to another operating system. The compiler doesn't contain header files. The compiler is only to compile your code into and object module and then the linker links all the files into an executable. As for an IDE, It makes writing source code easier. It packs all of the stuff you need to write a program into one application.
Last edited on
@haglerchristopher: Incorrect. Visual C++ only uses the .net framework if you create a .net project. If you create a regular Win32 project you won't be using .net at all.

@A Space Ostrich: I wonder why you were unable to find out the answer using Google or Bing or other search engine, as the situation is quite common. Searches like "what is stdafx.h" should yield positive and accurate results, which would have given you your answer, well, two days ago.

In any case, what you get is one of Microsoft's new project template that prepares the way for you. Don't want the template to get in your way? Simple: Create a Win32 project, and in the settings dialog box that appears make sure you select the correct project type (console in this case), then make sure you also check the "empty project" option. Once you have done that you simply add a new .cpp file and add that code.
Compilers convert lines of code into an executable file, also converting them into a more generic language to maximise compatability.


Actually, this is generally backwards (at least for C/C++), where you compile for your specific processor type/machine.
Yes, you can code in Notepad and then use a compiler to compile. But why do that when an IDE is sooo rich?


1. Control
2. Clarity
3. Control
4. The OS shell can be richer (IDE's and GUI interfaces have a closely bound history and share a common inspiration. The IDE is simply more specialized. The first GUI's were written by programmer for programmers.)
5. Control (over dependencies)
6. Syntax highlighting and "intelitype" hinder the acquisition of the ability to read code critically.
7. No waiting for unused development tools to load.



Why not?
1. Notepad won't auto indent
2. You're stuck with 8 character wide tab stops
3. Setting up a project takes longer at first.
4. The learning curve for using Microsoft's C/C++ compiler directly can be steeper.

Notepad is not the only plain text editor out there.
Last edited on
Topic archived. No new replies allowed.