RE: custom-built gcc 4.6.0 on ubuntu 11.04 links wrong libstdc++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi and thank you for your answer.

if i have a hello.C file with

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello" << endl;
}

and compile it with

g++ hello.C

ldd shows that a.out is linked to system libstdc++.

if i compile with

g++ -Wl,-rpath -Wl,$HOME/gcc-4.6.0 hello.C

in ldd i get correct libstdc++.

can i somehow configure (preferably while building gcc itself) that my g++ automatically gets these options?

----------------------------------------
> Date: Tue, 19 Apr 2011 20:19:38 +0200
> From: marc.glisse@xxxxxxxx
> To: raznorazno@xxxxxxxxxxx
> CC: gcc-help@xxxxxxxxxxx
> Subject: Re: custom-built gcc 4.6.0 on ubuntu 11.04 links wrong libstdc++
>
> On Tue, 19 Apr 2011, Razno Razno wrote:
>
> > my custom built gcc 4.6.0 on ubuntu 11.04, installed in home directory links the system libstdc++ from /usr/lib, most of the time, as evidenced by ldd. the only software i have managed to compile which links correct libstdc++ is the latest release of openmpi 1.5.3. sometimes this is a problem, and sometimes the compiled software just works. does anyone have an explanation on this, or a workaround?
>
> Look for "rpath" in the man page for ld(1).
>
> --
> Marc Glisse
 		 	   		  



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux