#### Archived

This topic is now archived and is closed to further replies.

# C++ Compiler

This topic is 5261 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m new to c++ and wondering what compiler I should use. I own Visual Studio.NET and wondering if that is a good choice. I want to use a compiler that professional programmers use so I learn the good way. I also want to be sure that it is possible to use my code (without so many changes) to compile to other OS then Windows. What I have heard, the .NET framework only works for Windows OS, I’m not sure that is true but perhaps I can use C++.NET anyway without using the .NET Framework? IF .NET is a bad choice what should I then use instead?

##### Share on other sites
VS.NET is a very good choice, especially the 2003 version (if that''s what you have, if you have 2002 that''s not bad either). If you want you can look into GCC (use the MinGW or cygwin variants under windows ... although windows libraries & headers don''t come with either by default - I guess it might work with the platform SDK ... maybe someone else knows better about this aspect).

You don''t need to use the .NET framework to create software under VS.NET - if you want to learn stick the the so called "Unmanaged Code". FWIW many professional programmers use VS.NET (or frequently the previous version, VS 6) under windows.

Generally code changes to compile to other OS''s are related to code for creating windows, drawing & the like. This can be got round with toolboxes such as QT. Alot of the rest of the stuff, such as file IO can be done in a platform indepentant mannor in the first place.

Good Luck!

##### Share on other sites
I think MinGW does come with windows libs & headers. You can certainly download them from the mingw site. Another compiler you could get is the Borland compiler. You can download either the C++Builder 5.5 commandline compiler (smaller download) or a full copy of C++BuilderX compiler and IDE (large download) from the Borland site free of charge, although you do have to give some details.

I''d recommend using multiple compilers as this will help to ensure that your code is standards compliant. GCC seems very standards compliant.

Enigma

##### Share on other sites
Incidentally if you get C++ Builder X, it has seamless support for compiling using ANY of the above compilers that you own (if you buy it in includes a lot of them), as well as providing Borland''s and MinGW.

##### Share on other sites
You can also try Dev-C++ from bloodshed.com

##### Share on other sites
Dev-C++ is an IDE... the compiler is usually MinGW...

##### Share on other sites
I have tested VisualStudio.NET (2003 version) and it seems to work realy good so i think i will be using that one.

I also tried Dev-C++ and that compiler is realy great but i think i rather use VS.NET now when i know that i dont need to use the framework.

Thanks for all the replys.

//DoRsal

##### Share on other sites
Can I encourage you to immediately find the option in VC++.NET that controls variable scope in for loops and set it to be standards compilant. I believe by default VC++.NET will allow this code:
for (int i = 0; i < 1; i++){}i = 2;

When it should give an error on the second line that i is undeclared. The correct behaviour can be obtained by changing the appropriate option.

Enigma

##### Share on other sites
quote:
Original post by Enigma
Can I encourage you to immediately find the option in VC++.NET that controls variable scope in for loops and set it to be standards compilant. I believe by default VC++.NET will allow this code:
for (int i = 0; i < 1; i++){}i = 2;

When it should give an error on the second line that i is undeclared. The correct behaviour can be obtained by changing the appropriate option.

Enigma

It is true that VC++.NET allow that code. I cant find any options for changing that though.

##### Share on other sites
This might help. I think you might be able to add the ''/Zc:forScope'' to the compiler options, rather than setting it for a single project. Not sure though!

Enigma

• 11
• 19
• 12
• 9
• 34
• ### Forum Statistics

• Total Topics
631398
• Total Posts
2999840
×