I've been crawling around the GNU/Unbutu websites for hours trying to find answers, with no such success. I expect that they can be answered by someone who's actually installed / fiddled around with these things. I haven't had any experience with these GNUish things before, but I do want to start testing my code on a platform other than Windows.
* Does Unbutu Desktop Edition come stock with C++0x support in the GCC compiler that it has? (It has a stock GCC compiler, right?) If not, how big of a hassle is it to set a C++0x compiler up for it?
* What C++0x features live in the std namespace in GCC4.5 (4.6?) IE. would I need to build boost on the system to access the (soon to be standard [std::shared_ptr : boost::shared_ptr]) smart pointers? Microsoft's compiler has the std::tr1 namespace, does GCC also?
* I've also read that boost might come stock on Unbutu, but have noticed a large number of threads on the Unbutu site with problems building boost. Some solutions were to install a few other tools to build it (remember, I'm a Linux newb here), and it just seemed like a huge headache.
From what I've read/worked with, the default install (I'm still using 10.04 I believe) comes with GCC 4.5.2, which I believe has a bit of 0x already working. [I'm often wrong]
You'll need to install the build-essential package on Ubuntu to get C++ working: apt-get install built-essential (add sudo to the beginning if you aren't root).
I think Linux Mint is better for beginning on Linux. It's the Ubuntu system but modified to be more user friendly for new users. As far as C++0x, I have been using some 0x code without any trouble. It gives me a warning about things but it is capable on compiling the code anyway. I use g++ to compile C++ code however, and gcc for C.
If you want to compile C++ code with gcc, use gcc -E. I don't know if it makes a difference to use that or g++... I would assume gcc -E just invokes g++.
I've been crawling around the GNU/Unbutu websites for hours trying to find answers, with no such success. I expect that they can be answered by someone who's actually installed / fiddled around with these things. I haven't had any experience with these GNUish things before, but I do want to start testing my code on a platform other than Windows.
Hours? Just download VMware Player, install Ubuntu, and check it out!
Hmm...unable to connect to the net, can't compile int main(){return 0;}...and the default installation is well, very purple. Guess another night will be wasted trying to configure things rather than laying some code.
google wrote:
unbuntu can't connect to internet
About 438,000 results (0.23 seconds)
Normally this wouldn't be an issue but using apt-get install built-essential seems to require connectivity.
...whatever I'm sticking with windows this is a losing battle. 80-90% of the google hits threads' were still unresolved.
I always use the DVD rather than the live CD... It's on the Ubuntu site but you have to click around "alternative downloads" after going to the download page to find it.
I'm pretty sure GCC is installed by default but I'll double check later today.
Ok, after a clean install of Ubuntu 10.10, g++ is not installed by default. Trying to run it displays the command to install it, though.
Here's the transcript:
me@my-virtual-machine:~$ g++ --version
The program 'g++' can be found in the following packages:
* g++
* pentium-builder
Try: sudo apt-get install <selected package>
me@my-virtual-machine:~$ sudo apt-get install g++
[sudo] password for me:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-2.6.35-22 linux-headers-2.6.35-22-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
g++-4.4 libstdc++6-4.4-dev
Suggested packages:
g++-multilib g++-4.4-multilib gcc-4.4-doc libstdc++6-4.4-dbg
libstdc++6-4.4-doc
The following NEW packages will be installed:
g++ g++-4.4 libstdc++6-4.4-dev
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,730kB of archives.
After this operation, 21.4MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ maverick/main libstdc++6-4.4-dev i386 4.4.4-14ubuntu5 [1,529kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ maverick/main g++-4.4 i386 4.4.4-14ubuntu5 [5,199kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ maverick/main g++ i386 4:4.4.4-1ubuntu2 [1,444B]
Fetched 6,730kB in 10s (615kB/s)
Selecting previously deselected package libstdc++6-4.4-dev.
(Reading database ... 145095 files and directories currently installed.)
Unpacking libstdc++6-4.4-dev (from .../libstdc++6-4.4-dev_4.4.4-14ubuntu5_i386.deb) ...
Selecting previously deselected package g++-4.4.
Unpacking g++-4.4 (from .../g++-4.4_4.4.4-14ubuntu5_i386.deb) ...
Selecting previously deselected package g++.
Unpacking g++ (from .../g++_4%3a4.4.4-1ubuntu2_i386.deb) ...
Processing triggers for man-db ...
Setting up libstdc++6-4.4-dev (4.4.4-14ubuntu5) ...
Setting up g++-4.4 (4.4.4-14ubuntu5) ...
Setting up g++ (4:4.4.4-1ubuntu2) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode.
me@my-virtual-machine:~$ g++ --version
g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
me@my-virtual-machine:~$