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:
if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
{PublicDependencyModuleNames.Add("XAudio2");
to
{PublicDependencyModuleNames.Add("ALAudio");
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).
if (Target.Platform == UnrealTargetPlatform.Win64){
// add libs for OpenAL
PublicAdditionalLibraries.Add(OpenALPath + "lib/Win64/common.lib");
PublicAdditionalLibraries.Add(OpenALPath + "lib/Win64/OpenAL32.lib");
}
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:
1> Creating library C:\dev\UnrealEngine-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-ALAudio.lib and object C:\dev\UnrealEngine-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-ALAudio.exp
1>Module.ALAudio.cpp.obj : error LNK2001: unresolved external symbol "struct FThreadSafeStaticStat<struct FStat_STAT_AudioResourceCreationTime> StatPtr_STAT_AudioResourceCreationTime" (?StatPtr_STAT_AudioResourceCreationTime@@3U?$FThreadSafeStaticStat@UFStat_STAT_AudioResourceCreationTime@@@@A)
1>C:\dev\UnrealEngine-release\Engine\Binaries\Win64\UE4Editor-ALAudio.dll : fatal error LNK1120: 1 unresolved externals
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.