Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-05

Link libglx library.

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Guillermo Martínez Jiménez

Hello.

I'm working on a project that needs the GLX library. It compiles but when running it returns that error:

./exbasic: symbol lookup error: /usr/local/lib/libagl.so: undefined symbol: glXQueryExtension

In other forum a colleague suggest that it doesn't links with the libglx.so . I'm trying to force it using the command line but it returns that error on compiling time:

Reply by email

Guillermo Martínez Jiménez
to Guillermo Martínez Jiménez

Hello.

I'm working on a project that needs the GLX library. It compiles but when running it returns that error:

./exbasic: symbol lookup error: /usr/local/lib/libagl.so: undefined symbol: glXQueryExtension

In other forum a colleague suggest that it doesn't links with the libglx.so . I'm trying to force it using the command line but it returns that error on compiling time:

fpc -02 -Sh -kglx examples/agl/exbasic.pp -oexamples/agl/exbasic ...
Target OS: Linux for i386
Compiling examples/agl/exbasic.pp
Linking examples/agl/exbasic
/usr/bin/ld: glx: No such file: No such file or directory

How should I do it?

Guillermo "Ñuño" Martínez

Reply by email

Jonas Maebe
to Guillermo Martínez Jiménez
Guillermo Martínez Jiménez wrote 18 lines
I'm working on a project that needs the GLX library. It compiles but when running it returns that error: ./exbasic: symbol lookup error: /usr/local/lib/libagl.so: undefined symbol: glXQueryExtension In other forum a colleague suggest that it doesn't links with the libglx.so . I'm trying to force it using the command line but it returns that error on compiling time: fpc -02 -Sh -kglx examples/agl/exbasic.pp -oexamples/agl/exbasic ... Target OS: Linux for i386 Compiling examples/agl/exbasic.pp Linking examples/agl/exbasic /usr/bin/ld: glx: No such file: No such file or directory How should I do it?

-klglx (note the extra "l").

Jonas

Reply by email

Guillermo Martínez Jiménez
Jonas Maebe wrote
-klglx (note the extra "l").

I tried that:

fpc -02 -Sh -FUlib/ -klglx /exbasic.pp -oexbasic

But it returns that error:

/usr/bin/ld: lglx: No such file: No such file or directory

I look for a dev package for GLX (libgl1-mesa-glx-dev?) but I can't find it. Which packages should I install on Ubuntu?

Guillermo "Ñuño" Martínez

Reply by email

Jonas Maebe
to Guillermo Martínez Jiménez
Guillermo Martínez Jiménez wrote 10 lines
Jonas Maebe wrote: > -klglx (note the extra "l"). I tried that: fpc -02 -Sh -FUlib/ -klglx /exbasic.pp -oexbasic But it returns that error: /usr/bin/ld: lglx: No such file: No such file or directory

Sorry, I made an error, it's -k-lglx

I look for a dev package for GLX (libgl1-mesa-glx-dev?) but I can't find it. Which packages should I install on Ubuntu?

I have no idea.

Jonas

Reply by email

Michalis Kamburelis
to Guillermo Martínez Jiménez: I tried that: fpc -02 -Sh -FUlib/ -klglx /exbasic.pp -oexbasic But it returns that error:…
Guillermo Martínez Jiménez wrote 14 lines
Jonas Maebe wrote: > -klglx (note the extra "l"). I tried that: fpc -02 -Sh -FUlib/ -klglx /exbasic.pp -oexbasic But it returns that error: /usr/bin/ld: lglx: No such file: No such file or directory I look for a dev package for GLX (libgl1-mesa-glx-dev?) but I can't find it. Which packages should I install on Ubuntu?

Because it should be -k-lglx (additional "-" inside). "-k" tells FPC to pass "-lglx" to the linker, and "-lglx" tells the linker to link with libglx.so.

But honestly, I think that you're running blind here. You should never link explicitly to libglx.so anyway, on Ubuntu you have libglx.so inside /usr/lib/xorg/modules/extensions --- which is not something that an ordinary program should link with. Your program should not need to link explicitly with any glx library. At least with FPC's glx.pp, the library is loaded dynamically, and actually (under normal Linux, not Mac OS X Darwin) glX functions are loaded straight from libGL.so. Note also your error message:

./exbasic: symbol lookup error: /usr/local/lib/libagl.so: undefined symbol: glXQueryExtension

This says something strange, the linker for some reason is looking for glXQueryExtension inside libagl.so. What exactly is /usr/local/lib/libagl.so? (It couldn't come from Ubuntu packages.) How (and why) are you linking with glX?

Michalis

Reply by email

Michalis Kamburelis
to Guillermo Martínez Jiménez: I tried that: fpc -02 -Sh -FUlib/ -klglx /exbasic.pp -oexbasic But it returns that error:…
Show quoted text 7 lines
Note also your error message: ./exbasic: symbol lookup error: /usr/local/lib/libagl.so: undefined symbol: glXQueryExtension This says something strange, the linker for some reason is looking for glXQueryExtension inside libagl.so.

Actually, re-reading this error message, it looks like libagl.so wants to be linked with something that provides glXQueryExtension. Try to compile with "-k-lGL".

If you don't fear to modify the FPC's sources, you can also try to change rtl/unix/dynlibs.inc to pass RTLD_GLOBAL to dlopen call, then recompile rtl and packages. Then the symbols from libGL (this includes glX symbols) should be available to libagl.so too.

Hope this helps,
Michalis

Reply by email