Archived

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

DoRsal

C++ Compiler

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 this post


Link to post
Share on other sites
Guest Anonymous Poster
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
quote:
Original post by Enigma
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


Yep... that helped... thanks!

Share this post


Link to post
Share on other sites
Visual Studio is plenty professional, there''s plenty of software development houses, including game development studios, that use it.

I''ve been using VC++ lately, but I also have a soft spot for Metrowerks Code Warrior. I like some of the editor features (it has way nicer options for color-coding source code), and it is available for multiple platforms (we used it at work because it runs on Windows and MacOS, so we only had to maintain one project file).

I''ve been liking Visual Studio''s editor a lot better with the .NET vesions, since they dumped MDI (ugh!) for a tabbed interface, and the debugger is better than Metroworks''.

If you already have a Visual Studio license and are starting out with C++, you''ve got all the tool you need. Definately don''t spend money on a different toolset until you know you need it (and I''m going to put on my asbestos underwear here and say you won''t find a better toolset for free/very cheap).

[Edited by - The_Incubator on June 14, 2006 2:17:34 PM]

Share this post


Link to post
Share on other sites