OpenAL Problems

Started by
5 comments, last by medevilenemy 18 years, 8 months ago
Does anyone know how to get OpenAL to link properly in Dev-Cpp? I've been trying, but with no success... Adding the libs to the project doesnt help, nor does #include - ing all the headers. If there is no known solution, can someone point me to an easily used Free Audio library (compatable with OpenGL)?
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.
Advertisement
FMod: http://www.fmod.org

Bass: http://www.un4seen.com/
I've had no problems linking Open AL at all. I'll go through it step by step, that way you shouldn't have any problems.

1. Click the 'Tools' menu.
2. Click the 'Compiler Options' menu item.
3. Click the 'Directories' tab.
4. Click the 'Libraries' tab.
5. Type in the path where you keep the Open AL static libraries stored in the text box found above the 'Replace' and 'Add' buttons.
6. Click the 'Add' button.
7. Click the 'Delete Invalid' button to check if you got it right.
8. Click the 'Compiler' tab.
9. Ensure that 'Add these commands to the linker command line' is toggled ON.
10. Type '-lopenal32' (no quotes) into the text box just below the check box mentioned in step 9. If there is other things in there, make sure you have spaces between that text, and the string '-lopenal32'.
11. Click the 'OK' button down the bottom.

I assume you've already got the headers worked out, if not, let me know, and I'll write out some more steps on how to set those up too.
Thank You Very Much Gorax, your solution worked (that is, steps 8-11) Now it compiles perfectly.

I should have audio playing (at least basically) in a couple of days...

Thank you again.
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.
oy, i'm afraid i spoke too soon...

Now when i run the program, it crashes. i tracked it down to alutInit(NULL, 0); But i'm not sure what's causing it.
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.
I'd strongly recommend not using any alut features, especially on Windows. On windows it is a static binary and is LGPL licensed which means it contaminates your code, but on all operating systems it is deprecated.

Replace alutInit with a few calls to set up a basic context (check out the devmaster.net OpenAL tutorials) and if you are using alut to load wav files it's incredibly simple to write your own wav loading code (PM me if you need it and I'll go ahead and post it here).
thanks for the advice,

That is actally the way i did it (initializing the context, etc seperately) (i did it last night). I had initially tried to do it the alutInit(NULL, 0); way, but it caused a fatal crash in my program, so i did some digging in the sample code that comes with the SDK and worked out a way to get it to work. Now it works quite well, i am very pleased.
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.

This topic is closed to new replies.

Advertisement