How to compile Pub.OpenAL on Linux?

BlitzMax Forums/BlitzMax Programming/How to compile Pub.OpenAL on Linux?

Vertex(Posted 2007) [#1]
Hi!

I want to compile the following code:
SuperStrict

Framework BRL.Blitz
Import Pub.OpenAL


On Ubuntu the result is:


dlopen and dlsym are the equivalent to Windows LoadLibrary and GetProcAddress and defined in dlfcn.h .

So how can I link dlopen and dlsym to my execute?
(btw. have BMax an own linker or use it from GCC/Flatassembler?)

cu olli


steph(Posted 2007) [#2]
Do you have the OpenAL-Development Libraries installed?


Vertex(Posted 2007) [#3]
No, and this is not necessary for this problem(or?). Becouse, the OpenAL library is loaded at runtime and so the library is not needed by compiling/linking the program.


N(Posted 2007) [#4]
You'll need it to link to the shared library.


FlameDuck(Posted 2007) [#5]
(btw. have BMax an own linker or use it from GCC/Flatassembler?)
It uses the GCC linker.

You need to install the OpenAL libraries.


Brucey(Posted 2007) [#6]
You need to :
Import "-ldl"



Vertex(Posted 2007) [#7]
Many thanks Brucey!!!
I've testet it with Import "libdl.a" or "libdl.so" but all doesn't work. (libdl.so can't import and libdl.a can't statically linked)

So for the future - how do you know that "-ldl" is needed? What can be linked with Import(outside of *.bmx, *.c, *.a, *.cpp)?

cu olli


Brucey(Posted 2007) [#8]
how do you know that "-ldl" is needed?

Experience ;-)

In reality, the -l is passed to the linker as you would when using it on the command line. So, for a library called libfish.so, you take of the prefix "lib", and the suffix ".so", leaving you "fish". You would then import with "-lfish".

:o)


Vertex(Posted 2007) [#9]
Ahh, ok, thank you :)