in reply to [OT] Installing g++ compiler on ubuntu-12.04LTS

sudo apt-get install g++

I've always thought this is silly, because g++ is really just a front-end for gcc. I guess the C++ libraries probably aren't loaded until g++ is installed, and the *nix-way is to keep things light weight so that the user only pays the price for those things he uses/wants/needs.

Anyway, installing "g++" is the step I usually forget when setting up a new system, and so far, is the step that gets C++ working for me on Ubuntu systems.

By the way, I'm starting to get more frequency in the FAIL reports on Inline::CPP where the problem shows up as a name-mangling issue, which is probably related to Inline::CPP failing to properly detect which libraries to use on the target system. That theory seems to have been accurate in those cases that I've been able to fix. But there are an increasing number of cases waiting to be fixed. If you (or anyone else here) notices a FAIL report and has an idea of what needs to happen to fix it, I'm open for suggestions. This cross-platform clean-install stuff is tricky for Inline::CPP, and I can use all the help I can get. :)


Dave

Replies are listed 'Best First'.
Re^2: [OT] Installing g++ compiler on ubuntu-12.04LTS
by syphilis (Archbishop) on Sep 19, 2013 at 03:14 UTC
    sudo apt-get install g++

    Yeah, that was the first thing I tried. It's good to hear that *should* have worked.
    I'll take it to the Ubuntu forums as jfroebe has suggested.

    This cross-platform clean-install stuff is tricky for Inline::CPP

    I've just set up a powerpc64 box running Debian wheezy. It has g++ (version 4.6.3) but Inline::CPP is not building. It might be a PEBKAC - if it turns out to be other than that, you'll here from me ;-)
    It was the problem on the deb box that led me to try out Inline::CPP on the Ubuntu machine - whereupon I discovered (to my surprise) that g++ was not installed.

    Cheers,
    Rob

      Let me know what you find out regarding the g++ install. Is it possible that it's installed but not in your path? Whatever it is, I'd like to know just for my own selfish edification.


      Dave

        Let me know what you find out regarding the g++ install

        Turns out it was just a problem I had been having with 'update' for a while. Some of the downloads would fail with "Encountered a section with no Package: header" or various other errors.

        According to what I had googled, the solution that should have worked was:
        sudo rm /var/lib/apt/lists/* -vf sudo apt-get update
        But that always resulted in the same (or similar) failures during sudo apt-get update.
        Today, after running that 'rm' command, I took a look to see what was in /var/lib/apt/lists, and there was a 'partial' directory, which I renamed to 'partial_hidden'.
        Then, when I ran the sudo apt-get update it all went smoothly and I was subsequently able to run sudo apt-get install g++.

        And Inline-CPP-0.45 now builds fine on the ubuntu box.

        The problem on the debian box is a little different. On that box, I can run gcc in either 32-bit mode or 64-bit mode (-m32 or -m64).
        But I can run g++ only in 32-bit mode. If I attempt to run it in 64-bit mode (g++ -m64) I'm told that the only exisitng libstdc++ it can find is incompatible.

        So ... I figure I need to find out how to install the 64-bit libstdc++.
        I've had a bit of a google around, but haven't yet found out how to do that.

        Geez ... and people call MS Windows arcane !!

        (Btw, Inline-CPP-0.45 builds and tests fine on the 32-bit perl on that deb box.)

        Cheers,
        Rob