Using OpenAL in Windows, LNK2001 error (unresolved external symbol)
I'm trying to port the OpenAL module to work in windows (x64) with Unreal Editor, to use OpenAL instead of XAudio in Windows. To do this, I first changed the build script (UnrealEd.Build.cs) line from:
which causes the ALAudio project to attempt to compile. I then had to change some lines in ALAudioBuffer.cpp due to differences between how gcc and VC++'13 handle casts from enumerated types, but I was able to get the code to compile.
In order to link to the proper OpenAL (in my case, OpenAL Soft) libraries, I added the following lines to the OpenAL build script (under ThirdParty\OpenAL\OpenAL.build.cs).
This resolves most of the link errors that I would normally get (which indicates to me that it is properly linking most of the openAL functions). Note that I've compiled files common.lib and OpenAL32.lib myself from the OpenAL Soft source using VS'13, so the libraries should be compatible with VS'13. I've also placed the library files in the proper directory (I'm using C:\dev\UnrealEngine-release\Engine\Source\ThirdParty\OpenAL\1.15.1\lib\Win64). However, I still get the linker error:
I'm not sure how to interpret this linker error, as I'm using the correct (AFAIK) headers and libraries for VS'13 (since I've built them myself).
Any help with this would be appreciated.
I did some more research and was able to get OpenAL working correctly under Windows. The key to getting it to link properly is to comment out the line:
which in the file ALAudioBuffer.cpp. This relates to some performance metric mechanism which doesn't seem to work the same way under Windows. I also had to modify the file ALAudioDevice.cpp and add PLATFORM_WINDOWS to the following pre-processor #ifs, to make OpenAL actually register itself as the audio context: e.g:
After these changes (and the above ones I've already stated in my question), OpenAL seems to work fine under Windows. Of course, you have to ensure that it uses ALAudio as the audio module, by editing WindowsEngine.ini:
Zuofu, can I download files that you changed for OpenAL use? And will it work with Rapture3D OpenAL? Thanks! :)
answered Nov 28 '17 at 02:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here