Package: openal-dev
Version: 1:0.0.8-1
Severity: important||



My system details:
[EMAIL PROTECTED]:~$ uname -a
Linux harima 2.6.15-1-k7 #2 Mon Mar 6 15:42:39 UTC 2006 i686 GNU/Linux


The issue is that a library flag, -lalut is missing from the printout of openal-config --libs. Without this flag, any attempts trying to compile code that uses alut calls will fail with undefined reference errors. It is no where documented in the OpenAL or ALUT documentation, nor in the libalut-dev documentation or any other Debian documentation (AFAIK). The libalut-dev package, version 1.0.1-1, is affected by this bug.

http://www.openal.org/openal_webstf/specs/alut.html#CompilingLinking

These instructions state that running the following two commands will tell you the necessary flags needed to build OpenAL (which may optionally use ALUT) programs:

openal-config --cflags
openal-config --libs


On my machine:

[EMAIL PROTECTED]:~$ openal-config --cflags

[EMAIL PROTECTED]:~$ openal-config --libs -lopenal


However gcc could not compile the simple test program below, taken from http://www.openal.org/openal_webstf/specs/alut.html

#include <stdlib.h>
#include <AL/alut.h>

int
main (int argc, char **argv)
{
 ALuint helloBuffer, helloSource;
 alutInit (&argc, argv);
 helloBuffer = alutCreateBufferHelloWorld ();
 alGenSources (1, &helloSource);
 alSourcei (helloSource, AL_BUFFER, helloBuffer);
 alSourcePlay (helloSource);
 alutSleep (1);
 alutExit ();
 return EXIT_SUCCESS;
}



Proof of this linking error, and the need for the -lalut flag, follow below. First I attempted to compile with no flags. Then I used only the -lopenal flag (which openal-config reports that that is all I need), and finally I include the -lalut flag, after which the program successfully compiles and executes.

[EMAIL PROTECTED]:~/dev/allacrost$ gcc audio_test.c /tmp/ccOtMkpQ.o: In function `main':audio_test.c:(.text+0x2a): undefined reference to `alutInit' :audio_test.c:(.text+0x2f): undefined reference to `alutCreateBufferHelloWorld'
:audio_test.c:(.text+0x45): undefined reference to `alGenSources'
:audio_test.c:(.text+0x5f): undefined reference to `alSourcei'
:audio_test.c:(.text+0x6a): undefined reference to `alSourcePlay'
:audio_test.c:(.text+0x77): undefined reference to `alutSleep'
:audio_test.c:(.text+0x7c): undefined reference to `alutExit'
collect2: ld returned 1 exit status

[EMAIL PROTECTED]:~/dev/allacrost$ gcc audio_test.c -lopenal
/tmp/ccoNWcDP.o: In function `main':audio_test.c:(.text+0x2a): undefined reference to `alutInit' :audio_test.c:(.text+0x2f): undefined reference to `alutCreateBufferHelloWorld'
:audio_test.c:(.text+0x77): undefined reference to `alutSleep'
:audio_test.c:(.text+0x7c): undefined reference to `alutExit'
collect2: ld returned 1 exit status

[EMAIL PROTECTED]:~/dev/allacrost$ gcc audio_test.c -lopenal -lalut
[EMAIL PROTECTED]:~/dev/allacrost$ ./a.out


Recommended solution: Add -lalut to the output of openal-config, as the OpenAL standard states that it should be present. It should be an easy fix. :)


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to