Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Allegro 4.9.7

This thread is locked; no one can reply to it. rss feed Print
Allegro 4.9.7
netcat
Member #6,097
August 2005

Trying to build under OS X 10.4 gives me this:
allegro/addons/kcm_audio/openal.c: In function '_openal_get_voice_position': allegro/addons/kcm_audio/openal.c:644: error: 'AL_SAMPLE_OFFSET' undeclared (first use in this function) allegro/addons/kcm_audio/openal.c:644: error: (Each undeclared identifier is reported only once allegro/addons/kcm_audio/openal.c:644: error: for each function it appears in.) allegro/addons/kcm_audio/openal.c: In function '_openal_set_voice_position': allegro/addons/kcm_audio/openal.c:657: error: 'AL_SAMPLE_OFFSET' undeclared (first use in this function) make[2]: *** [addons/kcm_audio/CMakeFiles/kcm_audio_shared.dir/openal.c.o] Error 1 make[1]: *** [addons/kcm_audio/CMakeFiles/kcm_audio_shared.dir/all] Error 2 make: *** [all] Error 2

Evert
Member #794
November 2000
avatar

Is it possible your version of OpenAL is outdated? What update of 10.4 are you on? Do you have the Fink package installed as well? If so, try moving it out of the way so /Library/Frameworks/OpenAL is used instead; check CMakeCache.txt to find out which version of OpenAL is being used.

netcat
Member #6,097
August 2005

I'm on 10.4.11. I tried downloading and installing another version of OpenAL from here but that didn't help much. I do not have the fink package.

Evert
Member #794
November 2000
avatar

Don't install OpenAL from a different source! you should use the version from Apple's install CD. See also http://www.allegro.cc/forums/thread/598146/780898#target, where something like this came up as well. We may need to add a note about this to the documentation.
What version of OpenAL do you have? Mine seem to be 1.1.

I said:

/Library/Frameworks/OpenAL

That should have been System/Library/Frameworks/OpenAL.framework

netcat
Member #6,097
August 2005

Looks like I have 1.1 as well. Doing

$ grep -r AL_SAMPLE_OFFSET .

in OpenAL.framework gives

Binary file ./OpenAL matches
Binary file ./Versions/A/OpenAL matches
Binary file ./Versions/Current/OpenAL matches

which reveals that the symbol should exist but it's nowhere to be found in the headers...

Kitty Cat
Member #2,815
October 2002
avatar

AL_SAMPLE_OFFSET is a macro defined in the al.h header. It's part of the OpenAL 1.1 spec (which isn't that new..), so if that's what OSX reports, that's what you should have.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

netcat
Member #6,097
August 2005

Hmm, OK, I got it to work by pasting the following lines into my altypes.h, from some altypes.h I found by googling.

1/**
2 * Source buffer position information
3 */
4#define AL_SEC_OFFSET 0x1024
5#define AL_SAMPLE_OFFSET 0x1025
6#define AL_BYTE_OFFSET 0x1026
7 
8/*
9 * Source type (Static, Streaming or undetermined)
10 * Source is Static if a Buffer has been attached using AL_BUFFER
11 * Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers
12 * Source is undetermined when it has the NULL buffer attached
13 */
14#define AL_SOURCE_TYPE 0x1027
15#define AL_STATIC 0x1028
16#define AL_STREAMING 0x1029
17#define AL_UNDETERMINED 0x1030

I tried a few examples, most seemed to work okay and I think I got about the same results as someone else earlier in the thread (i.e. NSAutoReleaseNoPool-stuff for ex_threads etc.).

Evert
Member #794
November 2000
avatar

Quote:

OK, I got it to work by pasting the following lines into my altypes.h, from some altypes.h I found by googling.

I don't like that solution, to be honest. As I said, it works out of the box for me so it sounds like something got broken on your system. I'm not sure this is the correct way to fix it.
Well, anyway, if it works, it works.

netcat
Member #6,097
August 2005

No, I agree that it is hardly the best solution, but it won't break anything so it will have to do until I can try building on my iMac with 10.5.



Go to: