Preferred C++ compiler for Windows

I

Ian deSouza

I have 15+ years of experience programming. 8 from the Unix C++ world,
and 7 in the Java (mainly windows) world. I can't get the following
program to create an executable in Microsoft Visual C++.

#include <iostream.h>

int main(int argc, char* argv[])
{
cout << "hello" << endl;
}

I want to non-windows specific code in my emacs editor...

Any suggestions as to a free easy to use compiler would be helpful...

Ian
 
V

Victor Bazarov

Ian deSouza said:
I have 15+ years of experience programming. 8 from the Unix C++ world,
and 7 in the Java (mainly windows) world. I can't get the following
program to create an executable in Microsoft Visual C++.

#include <iostream.h>

#include said:
int main(int argc, char* argv[])
{
cout << "hello" << endl;

std::cout << "hello" << std::endl;
}

I want to non-windows specific code in my emacs editor...

Any suggestions as to a free easy to use compiler would be helpful...

Look for MinGW (it's a flavour of GCC, IIRC). Comes as part of
"Dev-C++" IDE.

Victor
 
X

Xenos

Ian deSouza said:
I have 15+ years of experience programming. 8 from the Unix C++ world,
and 7 in the Java (mainly windows) world. I can't get the following
program to create an executable in Microsoft Visual C++.

#include <iostream.h>

int main(int argc, char* argv[])
{
cout << "hello" << endl;
}

I want to non-windows specific code in my emacs editor...

Any suggestions as to a free easy to use compiler would be helpful...

Ian

Stardard C++ headers no longer use the .h. And its really bad with VC++,
because you get the old, non-templatized versions which don't work with STL.
Plus, you need either a "using namespace std" line or prepend "std::" to
your cout and endl, since they are in the "std" namespace.

DrX
 
R

red floyd

Ian said:
I have 15+ years of experience programming. 8 from the Unix C++ world,
and 7 in the Java (mainly windows) world. I can't get the following
program to create an executable in Microsoft Visual C++.

#include <iostream.h>

int main(int argc, char* argv[])
{
cout << "hello" << endl;
}

I want to non-windows specific code in my emacs editor...

Any suggestions as to a free easy to use compiler would be helpful...

Ian
 
D

Derek Baker

Victor Bazarov said:
Look for MinGW (it's a flavour of GCC, IIRC). Comes as part of
"Dev-C++" IDE.

Victor

It *can* come as part of Dev-C++, which is how I use it. But it is available
standalone, and there are other IDEs for it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,148
Messages
2,570,838
Members
47,385
Latest member
Joneswilliam01

Latest Threads

Top