Advertisement

OpenAL linker errors

Started by December 23, 2004 01:44 AM
2 comments, last by Drew_Benton 20 years, 2 months ago
I'm getting some trouble trying to learn openAL. I've added the include and lib files to the project from C:\PROGRAM FILES\OPENAL 1.0 SOFTWARE DEVELOPMENT KIT\INCLUDE and C:\PROGRAM FILES\OPENAL 1.0 SOFTWARE DEVELOPMENT KIT\LIBS I was using the tutorial here on gamedev for reference at http://www.gamedev.net/reference/articles/article2008.asp So Visual C++ 6.0 is giving me these errors when I try to compile.
Quote:
OpenAL.obj : error LNK2001: unresolved external symbol _alutExit OpenAL.obj : error LNK2001: unresolved external symbol "void __cdecl alListenerfv(int,float *)" (?alListenerfv@@YAXHPAM@Z) OpenAL.obj : error LNK2001: unresolved external symbol "void __cdecl alSourcefv(unsigned int,int,float *)" (?alSourcefv@@YAXIHPAM@Z) OpenAL.obj : error LNK2001: unresolved external symbol _alutUnloadWAV OpenAL.obj : error LNK2001: unresolved external symbol _alutLoadWAVFile OpenAL.obj : error LNK2001: unresolved external symbol _alutInit Debug/OpenAL.exe : fatal error LNK1120: 6 unresolved externals
On a side note, I downloaded a prewritten demo of openAL and it compiles fine. I can't figure out what I'm doing wrong. Any help at all would be appreciated.
Add this in to your main header file:

#pragma comment(lib,"openal32.lib")
#pragma comment(lib,"alut.lib")

You just need to link the two OAL libs [wink]
Advertisement
Thanks! It compiled =)

I wonder why the other program is able to compile without those lines though... ah well whatever works =p

[Edited by - Omnibus on December 23, 2004 1:11:26 PM]
Quote:
Original post by Omnibus
Thanks! It compiled =)

I wonder why the other program is able to compile without those lines though... ah well whatever works =p


The reason was that they had linked them via Project Settings instead [wink]. Project->Project Settings->Link->Object/Library Modules.

Glad it worked!

This topic is closed to new replies.

Advertisement