954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Reccomended c++ compiler for laptop

I use Microsoft Visual Studio Professional on my Desktop PC, but my GTX 260 just failed and im dojng an RMA, so I started trying to program on my laptop. I am around 1/3 of the way through Ivor Hortons Beginning Visual C++, the book covers Native C++ and C++/CLI, I have only been reading the native parts and I have the been using MSVS to compile all the code, the book teaches some things that are in the current c++x0 draft and other new things that I havent yet been able to compile correctly in Code::Blocks because of the new things and I dont know what other IDE supports atleast half as many things as Visual Studio 2010. My laptops hardrive is too small to install Visual Studio. Is there a good alternative to Visual Studio small enough for my laptop?

One exmple that no other IDE has been able to compile:
double* value(nullptr);

L3gacy
Light Poster
38 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

Is there ANY compiler that compiles this?

double* value(nullptr);


I've never seen that, but the things I haven't seen outweigh the things I've seen, so take it with a grain of salt. Is that this?

double* value = 0;


There are compilers and there are IDEs. IDEs like Code Blocks and Visual Studio USE compilers. They are not compilers. That's why Code Blocks has two installations (with and without the compiler).

You can always install Visual Studio on an external drive if you don't have room on your laptop. If things don't compile with Code Blocks, that seems like the easiest thing to do.

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

Thanks for the reply, yes that is an equivalent expression.
The reason they changed it was so that is was clearer that the pointer was not pointing to any particular address.

The problem is that you need a windows installation for it to work, because of all the extra things that need to be installed and are available in the OS or am I wrong?

L3gacy
Light Poster
38 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

Go into C::B and open up Settings/Compiler and Debugger Settings and select GNU GCC Compiler at the top (assuming you load up C::B on your laptop with the default compiler). Select the Compiler Settings tab, and go down about 9 entries to "Have g++ follow the coming C++0x ISO C++ language standard [-std=c++0x]." That should allow you to use the new stuff.

jonsca
Quantitative Phrenologist
Team Colleague
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
 

The nullptr idiom was suggested by Stroustrup and Sutter, two well known faces in C++, in this draft proposal:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf

which you will see on this chart:

http://gcc.gnu.org/projects/cxx0x.html

is available from gcc 4.6

The intention is for it to become a keyword in C++0x. As such, it's currently non-standard and, of course, if you code in non-standard C++ you've got to expect non-standard responses across compilers.

Moschops
Practically a Master Poster
620 posts since Sep 2008
Reputation Points: 258
Solved Threads: 117
 

@OP I didn't realize that the introduction of stuff was staggered like that, so unless you have the 4.6 my suggestion won't work. Apologies.

jonsca
Quantitative Phrenologist
Team Colleague
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
 

Thanks for all the great replies everyone, is there an estimate as to when the draft for c++x0 will become official other than by the end of the decade?

L3gacy
Light Poster
38 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

It's like Duke Nukem Forever. It'll get here when it gets here :)

Moschops
Practically a Master Poster
620 posts since Sep 2008
Reputation Points: 258
Solved Threads: 117
 

What about the express edition of Visual C++? It's free, and it ought to be a fair bit smaller than the full version of Visual Studio. What's more, it supports all the same CLI and C++0x code as the full version, so far as I know.

embooglement
Junior Poster in Training
86 posts since Jul 2010
Reputation Points: 25
Solved Threads: 13
 

How do I install and use gcc 4.6 and link it in code::blocks?
MSVS Express is just as large as pro some 6 gigs+

L3gacy
Light Poster
38 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

gcc 4.6 hasn't been released yet. I checked on http://gcc.gnu.org/gcc-4.6/ and there are no stable builds listed on that page. You'd have to get a nightly release (I don't know where to find those) of the prerelease code. I'm not sure what the status of the mingw (the Windows port of gcc) is for 4.6, but since it's even less likely to be ready, you'd probably have to build the Linux nightly build under MSYS ( http://www.mingw.org/wiki/MSYS ).

I would get the latest mingw release (v.4.5.2) which is simple enough to set up (there's an installer now for Windows) and use that with Code::Blocks. You won't get all of the experimental keywords from C++0x, but using that website that Moschops posted, you can see how many of them are already available.

jonsca
Quantitative Phrenologist
Team Colleague
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
 

MS Visual Express C++ is just around 70 mb. The entire Visual Studio Express is that big. You can download only the C++ component.

adarshcu
Junior Poster
121 posts since May 2008
Reputation Points: 19
Solved Threads: 26
 

I downloaded the unofficial build of 4.6 from here: http://gcc.gnu.org/wiki/GFortranBinaries

I installed it but dont know what to do with it, oh it sucks being a noob.
I'll bet thats not even the right one. I pointed code::blocks to the install location but it didnt work.

@adar i'll check out just the c++ component.

L3gacy
Light Poster
38 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

If the install was right, you can use gcc without an IDE. Do a quick "Hello World" program and compile it from the command line with no IDE:

gcc HelloWorld.c -o HelloWorld


Run it and verify it works. Then and only then point Code Blocks to it.

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

That looks like the ForTran version. You want the C++ version.

Moschops
Practically a Master Poster
620 posts since Sep 2008
Reputation Points: 258
Solved Threads: 117
 

Yesterday I went on the gcc website and downloaded the 4.6 snapshot but inside was just a bunch of files.

L3gacy
Light Poster
38 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

>> Yesterday I went on the gcc website and downloaded the 4.6 snapshot but inside was just a bunch of files.

That's the downside of installing something before the "official release". With the official releases, usually there is a big README with options for installers, etc.

If you get it from Subversion or before they've tidied it all up with instructions, you sometimes get just a big zip file or whatever, but usually there's SOMETHING there with some explanation of what to do. You may or may not have to "build your own". Anyway, those files go somewhere, so if you have time, you may want to install the last stable version, look at where everything ends up, uninstall it, then look at the new files and see if they "match" and stick them there.

Bottom line is if you're willing to put in the time, something as big as gcc is going to have instructions somewhere, but whenever you aren't working with the "official, stable" release, you have to expect that it may take more than a few clicks. I'm talking about projects in general, not just gcc.

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

Right now, I don't think any compiler has it all. Here's Scott Meyer's page linking to various other pages, showing C++0X implementation.

http://www.aristeia.com/C++0x/C++0xFeatureAvailability.htm

Moschops
Practically a Master Poster
620 posts since Sep 2008
Reputation Points: 258
Solved Threads: 117
 

Thanks for the excellent answers everyone.

L3gacy
Light Poster
38 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

I want to start by saying hello.
It's my first post,so forgive me if I make any mistake.
I am using Borland C++ 3.1 on my laptop,and I am happy.
It's easy,I use it at school too so I am used with it and it's small(installer has ~20Mb).

Baluba15
Newbie Poster
3 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
 
View similar articles that have also been tagged: