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);

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.

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?

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.

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


which you will see on this chart:


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.

commented: Good to know! +6

@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.

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?

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

Member Avatar

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.

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+

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.

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

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.

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.

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

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

>> 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.

Thanks for the excellent answers everyone.

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).

@Baluba: Borland C++ 3.1 dates back to 1992. It's a 16bit compiler for Windows 3.1. That's prehistoric dude! There has been almost 3 revisions of the C++ standard since then and plenty of extensions to the standard libraries too.

@L3gacy and VernonDozier: If you want the very latest gcc (with best support of C++0x and GNU++0x), you will have to download the source from the Subversion server and then follow the build instructions (it took me a few hours on a laptop to compile it yesterday, and quite a bit less on my desktop computer, like 30min). I guess this is mostly for *nix based systems so I doubt that it can be done as easily for Windows. You are probably better waiting for the official MinGW release, and stick with GCC 4.5.2 for now.