View mode: basic / threaded / horizontal-split · Log in · Help
September 24, 2004
Getting dmd to work on Linux
I'm thinking about embarking on my first large project in D, and the result
needs to run on Linux and Win32.  Dmd seems to work fine on Win32.  But on
Linux, I get this:

dmd: error while loading shared libraries: libstdc++.so.5: cannot open shared
object file: No such file or directory

I searched through the archives, and this seems to be a common problem, but I
have not found any solution to the problem as of yet.  I also have no control
over the Linux box or any of the /etc, /lib, or /usr directories.  Also, I don't
even know what distribution of Linux is on this box.

Any ideas on getting 'dmd' working on Linux?

Thanks!
-- Glenn Lewis
September 24, 2004
Re: Getting dmd to work on Linux
"Glenn M. Lewis" <Glenn_member@pathlink.com> wrote in message
news:cj1lu1$bab$1@digitaldaemon.com...
> I'm thinking about embarking on my first large project in D, and the
result
> needs to run on Linux and Win32.  Dmd seems to work fine on Win32.  But on
> Linux, I get this:
>
> dmd: error while loading shared libraries: libstdc++.so.5: cannot open
shared
> object file: No such file or directory
>
> I searched through the archives, and this seems to be a common problem,
but I
> have not found any solution to the problem as of yet.  I also have no
control
> over the Linux box or any of the /etc, /lib, or /usr directories.  Also, I
don't
> even know what distribution of Linux is on this box.
>
> Any ideas on getting 'dmd' working on Linux?

I (unfortunately) don't know what exactly needs updating so I just went and
got RedHat 9 and that works like a charm. Presumably Fedora Core 2 is also
fine. It probably is possible to fix your current box - I just don't know
how.

> Thanks!
> -- Glenn Lewis
>
>
September 24, 2004
Re: Getting dmd to work on Linux
> dmd: error while loading shared libraries: libstdc++.so.5: cannot open
shared
> object file: No such file or directory
>
> Any ideas on getting 'dmd' working on Linux?

let's play dirty and try:
ln -s /usr/lib/libstdc++.so /usr/lib/libstdc++.so.5
September 24, 2004
Re: Getting dmd to work on Linux
i'm not sure exactly what the problem is.
I know dmd uses gcc. Do you have g++ installed?
What distro do you have?

Glenn M. Lewis wrote:
> I'm thinking about embarking on my first large project in D, and the result
> needs to run on Linux and Win32.  Dmd seems to work fine on Win32.  But on
> Linux, I get this:
> 
> dmd: error while loading shared libraries: libstdc++.so.5: cannot open shared
> object file: No such file or directory
> 
> I searched through the archives, and this seems to be a common problem, but I
> have not found any solution to the problem as of yet.  I also have no control
> over the Linux box or any of the /etc, /lib, or /usr directories.  Also, I don't
> even know what distribution of Linux is on this box.
> 
> Any ideas on getting 'dmd' working on Linux?
> 
> Thanks!
> -- Glenn Lewis
> 
>
September 24, 2004
Re: Getting dmd to work on Linux
"Glenn M. Lewis" wrote:
> 
> I'm thinking about embarking on my first large project in D, and the result
> needs to run on Linux and Win32.  Dmd seems to work fine on Win32.  But on
> Linux, I get this:
> 
> dmd: error while loading shared libraries: libstdc++.so.5: cannot open shared
> object file: No such file or directory
> 
> I searched through the archives, and this seems to be a common problem, but I
> have not found any solution to the problem as of yet.  I also have no control
> over the Linux box or any of the /etc, /lib, or /usr directories.  Also, I don't
> even know what distribution of Linux is on this box.
> 
> Any ideas on getting 'dmd' working on Linux?

I'm sure it has to do with an older version of gcc that you use.
It's nowhere specified what version you need (Walter?!).
I had the same problem with a PC that uses gcc 2.95
On another machine with gcc 3.3 it runs fine.

The suggest soft link doesn't help, I tried that.

-- 
Helmut Leitner    leitner@hls.via.at
Graz, Austria   www.hls-software.com
September 24, 2004
Re: Getting dmd to work on Linux
Glenn M. Lewis wrote:
> I'm thinking about embarking on my first large project in D, and the result
> needs to run on Linux and Win32.  Dmd seems to work fine on Win32.  But on
> Linux, I get this:
> 
> dmd: error while loading shared libraries: libstdc++.so.5: cannot open shared
> object file: No such file or directory
> 
> I searched through the archives, and this seems to be a common problem, but I
> have not found any solution to the problem as of yet.  I also have no control
> over the Linux box or any of the /etc, /lib, or /usr directories.  Also, I don't
> even know what distribution of Linux is on this box.
> 
> Any ideas on getting 'dmd' working on Linux?
> 
> Thanks!
> -- Glenn Lewis
> 
> 


Which gcc version are you using?  Open a command prompt and type gcc 
--version.

This may be important to know.  Anything 3.4'ish seems to need a c++ 
compatibility library compiled in separately to support compilation of 
pre-3.4 based c++ programs.  I'm not quite sure of the specifics of this 
issue, but I've had it happen before, I think.  I just can't remember 
how I fixed it.

At the very least, though, in order to get to the bottom of the issue, 
you'll have to give a little more information: linux distribution, gcc 
version, etc.

Later,

John
September 24, 2004
Re: Getting dmd to work on Linux
I believe the distribution is RedHat 7, although I could easily be mistaken.
I've got 3 flavors of gcc available to me:
% which6 gcc
/usr/site/bin/gcc
/usr/bin/gcc
/usr/local/bin/gcc
% /usr/site/bin/gcc --version
gcc (GCC) 3.1
Copyright (C) 2002 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.

% /usr/bin/gcc --version
2.96
% /usr/local/bin/gcc --version
2.7.2.3

It looks like maybe I should build my own private version of gcc 3.4.
-- Glenn

>Which gcc version are you using?  Open a command prompt and type gcc 
>--version.
>
>This may be important to know.  Anything 3.4'ish seems to need a c++ 
>compatibility library compiled in separately to support compilation of 
>pre-3.4 based c++ programs.  I'm not quite sure of the specifics of this 
>issue, but I've had it happen before, I think.  I just can't remember 
>how I fixed it.
>
>At the very least, though, in order to get to the bottom of the issue, 
>you'll have to give a little more information: linux distribution, gcc 
>version, etc.
>
>Later,
>
>John
September 24, 2004
Re: Getting dmd to work on Linux
OK, I found a fully-built version of GCC 3.3 on the system so I did this:

% echo $LD_LIBRARY_PATH 
/usr/site/pkgs/gcc/3.3/lib:/lib

Now, I try to run 'dmd':
% dmd
dmd: /lib/libc.so.6: version `GLIBC_2.3' not found (required by dmd)
% ldd dmd/bin/dmd
dmd/bin/dmd: /lib/libc.so.6: version `GLIBC_2.3' not found (required by
dmd/bin/dmd)
libstdc++.so.5 => /usr/site/pkgs/gcc/3.3/lib/libstdc++.so.5 (0x40018000)
libc.so.6 => /lib/libc.so.6 (0x400cf000)
libm.so.6 => /lib/libm.so.6 (0x4020e000)
libgcc_s.so.1 => /usr/site/pkgs/gcc/3.3/lib/libgcc_s.so.1 (0x40231000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

OK, so I'm stuck again.  Any ideas?
-- Glenn

In article <cj26m5$jf5$1@digitaldaemon.com>, Glenn M. Lewis says...
>
>I believe the distribution is RedHat 7, although I could easily be mistaken.
>I've got 3 flavors of gcc available to me:
>% which6 gcc
>/usr/site/bin/gcc
>/usr/bin/gcc
>/usr/local/bin/gcc
>% /usr/site/bin/gcc --version
>gcc (GCC) 3.1
>Copyright (C) 2002 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.
>
>% /usr/bin/gcc --version
>2.96
>% /usr/local/bin/gcc --version
>2.7.2.3
>
>It looks like maybe I should build my own private version of gcc 3.4.
>-- Glenn
>
>>Which gcc version are you using?  Open a command prompt and type gcc 
>>--version.
>>
>>This may be important to know.  Anything 3.4'ish seems to need a c++ 
>>compatibility library compiled in separately to support compilation of 
>>pre-3.4 based c++ programs.  I'm not quite sure of the specifics of this 
>>issue, but I've had it happen before, I think.  I just can't remember 
>>how I fixed it.
>>
>>At the very least, though, in order to get to the bottom of the issue, 
>>you'll have to give a little more information: linux distribution, gcc 
>>version, etc.
>>
>>Later,
>>
>>John
>
>
September 24, 2004
Re: Getting dmd to work on Linux
Glenn M. Lewis wrote:
> OK, I found a fully-built version of GCC 3.3 on the system so I did this:
> 
> % echo $LD_LIBRARY_PATH 
> /usr/site/pkgs/gcc/3.3/lib:/lib
> 
> Now, I try to run 'dmd':
> % dmd
> dmd: /lib/libc.so.6: version `GLIBC_2.3' not found (required by dmd)
> % ldd dmd/bin/dmd
> dmd/bin/dmd: /lib/libc.so.6: version `GLIBC_2.3' not found (required by
> dmd/bin/dmd)
> libstdc++.so.5 => /usr/site/pkgs/gcc/3.3/lib/libstdc++.so.5 (0x40018000)
> libc.so.6 => /lib/libc.so.6 (0x400cf000)
> libm.so.6 => /lib/libm.so.6 (0x4020e000)
> libgcc_s.so.1 => /usr/site/pkgs/gcc/3.3/lib/libgcc_s.so.1 (0x40231000)
> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
> 
> OK, so I'm stuck again.  Any ideas?

from http://packages.debian.org/testing/base/libstdc++5:

libstdc++.so.5 contains the GNU Standard C++ Library v3, which is a 
complete rewrite from the previous v2, which was included up to 
g++-2.95. The first version of libstdc++-v3 appeared in g++-3.0.

Did you have gcc 3.1 as well? Does `find / -name "libstdc++.so.5"` give 
any more libraries? Try adding more of these paths to LD_LIBRARY_PATH...

Alternatively you can try downloading the libs and installing them in 
~/lib for example, and set LD_LIBRARY_PATH accordingly.

Good luck!

Bastiaan.
September 24, 2004
Re: Getting dmd to work on Linux
Glenn M. Lewis wrote:
> I believe the distribution is RedHat 7, although I could easily be mistaken.
> I've got 3 flavors of gcc available to me:
> % which6 gcc
> /usr/site/bin/gcc
> /usr/bin/gcc
> /usr/local/bin/gcc
> % /usr/site/bin/gcc --version
> gcc (GCC) 3.1
> Copyright (C) 2002 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.
> 
> % /usr/bin/gcc --version
> 2.96
> % /usr/local/bin/gcc --version
> 2.7.2.3
> 
> It looks like maybe I should build my own private version of gcc 3.4.
> -- Glenn
> 

Well... Gcc 3.4 probably wouldn't fix the problem (it's not considered 
completely stable yet anyway).  Currently, I believe, gcc 3.3.x is 
considered stable, so perhaps getting a full version of that installed 
would be beneficial.
« First   ‹ Prev
1 2 3
Top | Discussion index | About this forum | D home