Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by syphilis (Canon)
on Sep 18, 2013 at 13:52 UTC ( #1054660=perlquestion: print w/ replies, xml ) Need Help??
syphilis has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm interested in installing Inline::CPP on my ubuntu box.
Obviously I need g++ for that but, although gcc-4.6.3 is installed, I don't seem to have g++:
sisyphus@sisyphus5-desktop:~$ g++ -v The program 'g++' can be found in the following packages: * g++ * pentium-builder Try: sudo apt-get install <selected package> sisyphus@sisyphus5-desktop:~$
So I tried:
sisyphus@sisyphus5-desktop:~$ sudo apt-get install g++ Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: g++:i386 : Depends: cpp:i386 (>= 4:4.6.3-1ubuntu5) but it is not goin +g to be installed Depends: gcc:i386 (>= 4:4.6.3-1ubuntu5) but it is not goin +g to be installed Depends: g++-4.6:i386 (>= 4.6.3-1~) but it is not going to + be installed Depends: gcc-4.6:i386 (>= 4.6.3-1~) but it is not going to + be installed E: Unable to correct problems, you have held broken packages. sisyphus@sisyphus5-desktop:~$
and I also tried:
sisyphus@sisyphus5-desktop:~$ sudo apt-get install pentium-builder Reading package lists... Done Building dependency tree Reading state information... Done Package pentium-builder is not available, but is referred to by anothe +r package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'pentium-builder' has no installation candidate sisyphus@sisyphus5-desktop:~$
and (although I already have a very serviceable gcc-4.6.3 and make), I tried:
sisyphus@sisyphus5-desktop:~$ sudo apt-get install build-essential Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: build-essential : Depends: g++ (>= 4:4.4.3) but it is not installable Depends: dpkg-dev (>= 1.13.5) but it is not going t +o be installed E: Unable to correct problems, you have held broken packages. sisyphus@sisyphus5-desktop:~$
Any advice on how to install g++ ?

Cheers,
Rob

Comment on [OT] Installing g++ compiler on ubuntu-12.04LTS
Select or Download Code
Re: [OT] Installing g++ compiler on ubuntu-12.04LTS
by jfroebe (Vicar) on Sep 18, 2013 at 14:39 UTC
Re: [OT] Installing g++ compiler on ubuntu-12.04LTS
by davido (Archbishop) on Sep 18, 2013 at 15:19 UTC
    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

      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

Re: [OT] Installing g++ compiler on ubuntu-12.04LTS
by Anonymous Monk on Sep 19, 2013 at 14:54 UTC
    You probably have added some repositories that don't match the base system; you should remove them, apt-get update and retry.

    (It's been ages since I last ran across that error, so take this with a grain of salt)

Re: [OT] Installing g++ compiler on ubuntu-12.04LTS ( apt-get install lib64stdc++6 )
by Anonymous Monk on Sep 20, 2013 at 10:37 UTC
      So try apt-get install lib64stdc++6

      Thanks Anonymous Monk. Running that command indicates that it was already installed and up to date. Closer inspection revealed that /usr/lib64/libstdc++.so.6.0.17 and a symlink to it (/usr/lib64/libstdc++.so.6) were already present.

      Creating another symlink (/usr/lib64/libstdc++.so) to the .so.6.0.17 object fixes my problem.
      I presume that's the right way to fix it ? Seems odd that the /usr/lib64/libstdc++.so symlink was not already present.

      I can now run g++ in either 64-bit mode or 32-bit mode, and can successfully build and install Inline-CPP-0.45 in either 32-bit or 64-bit builds of perl. (David, the correct g++ compiler and options are automatically set by the Inline-CPP Makefile.PL. It all now works fine for me.)

      Thanks, guys !!

      Cheers,
      Rob

        Creating another symlink (/usr/lib64/libstdc++.so) to the .so.6.0.17 object fixes my problem. I presume that's the right way to fix it ? Seems odd that the /usr/lib64/libstdc++.so symlink was not already present.

        Yes, I think so (right way), and I also think it odd it didn't happen already -- but I've seen my share of almost-complete/correct binary packages :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1054660]
Approved by chacham
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-12-19 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (81 votes), past polls