Question about IDE's

I don't know if this is the right forum for this but it seems to fit. So I hope I do not offend anyone.

Every one of the tutorials I have read produce the Hello World program in exactly the same way. Some say not to use the Bloodshed Dev C++ because it is no longer supported and has not been updated in over five years. I want to learn programs for Windows so it is logical to use the free MSDevStudio. However, the Hello World example provided in the MS Dev Studio is not the same as the ones in the tutorials. Can anybody give a concise definition of each of the components found in the MS Dev Studio example? I cannot understand why Microsoft has to do it completely different than anyone else. Does this mean everyone will have to jump on board the way MS does it? Just curious considering, if I want to develop for MS products, I will have to do it their way. Unfortunately, even their own tutorial does not match the way it is done in MSDS 2010 and above. I would appreciate it if someone could help me out in my confusion.

Thank you very much before hand.

dwolfer
I have never used MS Dev Studio, but I do know that you should be able to print "Hello World" in a console the same way in all IDE's. IDE's are just the development environment (hence the D and E standing for development environment). Compilers are the important part. Compilers are the thing that actually makes the code work. Like I said, the IDE is just the GUI you use to type in the code. The compiler takes the code and translates it into binary or other machine language. The way you would make a hello world program is:

1
2
3
4
5
6
#include <iostream>
using namespace std;

int main(){
    cout<<"Hello World"<<endl;
}


I use Qt Creator and VSE 2013 and they both work. VSE2013 is microsoft. The way I know how to make Windows applications is using the API. This is the <windows.h> header. You can find tutorials on msdn.com for that.

And you seem new to programming, so I am just going to give you advice:
I wouldn't jump right to windows development yet. Learn a bit of C / C++ first, that way you are more experienced. I spent about 5 months learning C++ b4 I started learning Win development.

A little bit more advice, then I'm done:
WinAPI isn't the only way to develop for windows. There are cross-platform libraries out there that are much easier and more updated, such as Qt, SFML, STL, etc. That way, you still are developing for windows, but can also distribute your projects to other OS's.
It's probably a visual c++ build instead of normal c++. If by weird you mean something like _tmain. If when you say weird you see the "#include "stdafx.h" that is a precompiled header. The visual c++ tutorial is here I believe which is probably the one you looked http://msdn.microsoft.com/en-us/library/jj620919.aspx
Here is the problem:

// Learning Cpluplus.cpp : main project file.

The following is the code provide by 2010 Express sudio from Microsoft and it compiles correctly but I di on understand it because it is so different from the examples provided in all the tutorials I have looked through.

/*
#include "stdafx.h"

using namespace System;
/
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
return 0;
}
*/

The following is code provided by every tutorial I have looked at. This code does not even compile in the 2010 Express Studio from MS

// my first program in C++
#include <iostream>
#include "stdafx.h"

int main()
{
std::cout << "Hello World!";
}



I commented out the code provided by 2010 Express and then copied in the code you see directly above.

When I try to compile the above code the out put of the build is as follows:

1>------ Build started: Project: Learning Cpluplus, Configuration: Release Win32 ------
1> Learning Cpluplus.cpp
1>Learning Cpluplus.cpp(15): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>Learning Cpluplus.cpp(20): error C2039: 'cout' : is not a member of 'std'
1>Learning Cpluplus.cpp(20): error C2065: 'cout' : undeclared identifier
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



I see recommendations for IDE's / compilers like Dev C++ but from what I can determine it has not been updated in over five years. Others have their problems too. It seems like there are major problems with all these free compilers / IDE's. That is why finally the suggestion was to use the Express studio 2010 but I can't even get past the first example. I can not believe how something that should be so straight forward can be made so difficult.
Both these examples are supposed to be console apps. Could someone explain what the differences are between these two examples? Thanks in advance.
http://www.cplusplus.com/doc/tutorial/introduction/visualstudio/

The first one is c++/CLI the latter is c++.
Last edited on
Yes, you're compiling the wrong language. The top one is not C++.

Another thing that microsoft assumes you do is that you use pre-compiled headers (stdafx.h). I loathe this header. You either need to place it as the first line (above iostream) or remove it and uncheck the "Use precompiled headers" box in the project properties.
Last edited on
Topic archived. No new replies allowed.