www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Problem this names of shared libraries

reply "mezozoysky" <neferegio gmail.com> writes:
Hello!
I'm not sure if this is the right thread for this question. If 
you know in which thread this question should be, please point me 
to it.

I've see a strange things using dmd 2.059 with my debian/testing 
os.
Linker returns an error, when I link external shared libraries to 
my code.

I ran the following:

$ dmd -ofbin/example ./src/example/main.o -L-lGL -L-lGLU -L-ldl

& I've got:

/usr/bin/ld: cannot find -lGL
/usr/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status
--- errorlevel 1

this occurs until I have libGL.so.1 & libGLU.so.1 in /usr/lib, 
but since I've created symlinks libGL.so & libGLU.so in the same 
directory, it links ok.

What is this: dmd bug? OS or ld misconfiguration? something else?

Please tell me if I'm doing something wrong.
Jun 26 2012
next sibling parent "mezozoysky" <neferegio gmail.com> writes:
Oh... sorry for typos.
Jun 26 2012
prev sibling next sibling parent Jacob Carlborg <doob me.com> writes:
On 2012-06-26 10:45, mezozoysky wrote:
 Hello!
 I'm not sure if this is the right thread for this question. If you know
 in which thread this question should be, please point me to it.

 I've see a strange things using dmd 2.059 with my debian/testing os.
 Linker returns an error, when I link external shared libraries to my code.

 I ran the following:

 $ dmd -ofbin/example ./src/example/main.o -L-lGL -L-lGLU -L-ldl

 & I've got:

 /usr/bin/ld: cannot find -lGL
 /usr/bin/ld: cannot find -lGLU
 collect2: ld returned 1 exit status
 --- errorlevel 1

 this occurs until I have libGL.so.1 & libGLU.so.1 in /usr/lib, but since
 I've created symlinks libGL.so & libGLU.so in the same directory, it
 links ok.

 What is this: dmd bug? OS or ld misconfiguration? something else?

 Please tell me if I'm doing something wrong.

As far as I know -L is just piped through to the linker. -- /Jacob Carlborg
Jun 26 2012
prev sibling next sibling parent "mezozoysky" <neferegio gmail.com> writes:
On Tuesday, 26 June 2012 at 10:23:32 UTC, Jacob Carlborg wrote:
 On 2012-06-26 10:45, mezozoysky wrote:
 Hello!
 I'm not sure if this is the right thread for this question. If 
 you know
 in which thread this question should be, please point me to it.

 I've see a strange things using dmd 2.059 with my 
 debian/testing os.
 Linker returns an error, when I link external shared libraries 
 to my code.

 I ran the following:

 $ dmd -ofbin/example ./src/example/main.o -L-lGL -L-lGLU -L-ldl

 & I've got:

 /usr/bin/ld: cannot find -lGL
 /usr/bin/ld: cannot find -lGLU
 collect2: ld returned 1 exit status
 --- errorlevel 1

 this occurs until I have libGL.so.1 & libGLU.so.1 in /usr/lib, 
 but since
 I've created symlinks libGL.so & libGLU.so in the same 
 directory, it
 links ok.

 What is this: dmd bug? OS or ld misconfiguration? something 
 else?

 Please tell me if I'm doing something wrong.

As far as I know -L is just piped through to the linker.

Yes, I know it. Does it means that I have problem with ld instead of dmd piping?
Jul 03 2012
prev sibling next sibling parent "Tobias Pankrath" <panke tzi.de> writes:
On Wednesday, 4 July 2012 at 05:15:20 UTC, mezozoysky wrote:
 On Tuesday, 26 June 2012 at 10:23:32 UTC, Jacob Carlborg wrote:
 On 2012-06-26 10:45, mezozoysky wrote:
 Hello!
 I'm not sure if this is the right thread for this question. 
 If you know
 in which thread this question should be, please point me to 
 it.

 I've see a strange things using dmd 2.059 with my 
 debian/testing os.
 Linker returns an error, when I link external shared 
 libraries to my code.

 I ran the following:

 $ dmd -ofbin/example ./src/example/main.o -L-lGL -L-lGLU 
 -L-ldl

 & I've got:

 /usr/bin/ld: cannot find -lGL
 /usr/bin/ld: cannot find -lGLU
 collect2: ld returned 1 exit status
 --- errorlevel 1

 this occurs until I have libGL.so.1 & libGLU.so.1 in 
 /usr/lib, but since
 I've created symlinks libGL.so & libGLU.so in the same 
 directory, it
 links ok.

 What is this: dmd bug? OS or ld misconfiguration? something 
 else?

 Please tell me if I'm doing something wrong.

As far as I know -L is just piped through to the linker.

Yes, I know it. Does it means that I have problem with ld instead of dmd piping?

You could try to build with -c and link by hand to check this.
Jul 03 2012
prev sibling next sibling parent Johannes Pfau <nospam example.com> writes:
Am Wed, 04 Jul 2012 07:15:18 +0200
schrieb "mezozoysky" <neferegio gmail.com>:

 On Tuesday, 26 June 2012 at 10:23:32 UTC, Jacob Carlborg wrote:
 On 2012-06-26 10:45, mezozoysky wrote:
 What is this: dmd bug? OS or ld misconfiguration? something 
 else?

 Please tell me if I'm doing something wrong.

As far as I know -L is just piped through to the linker.

Yes, I know it. Does it means that I have problem with ld instead of dmd piping?

It seems linux distributions lately put these symlinks into their *-dev packages (the packages also containing the c headers). You could try to install libglu1-mesa-dev and libgl-mesa-dev
Jul 04 2012
prev sibling parent "mezozoysky" <neferegio gmail.com> writes:
Thank You, Tobias & Johannes. I'll check it.
Jul 08 2012