1>CMakeCCompilerId.c.obj : error LNK2005: main already defined in Module.ResonanceAudio.cpp.obj
1>main.c.obj : error LNK2005: main already defined in Module.ResonanceAudio.cpp.obj
1> Creating library C:\Coding\Engine\Plugins\Runtime\ResonanceAudio\Intermediate\Build\Win64\UE4Editor\Development\ResonanceAudio\UE4Editor-ResonanceAudio.suppressed.lib and object C:\Coding\Engine\Plugins\Runtime\ResonanceAudio\Intermediate\Build\Win64\UE4Editor\Development\ResonanceAudio\UE4Editor-ResonanceAudio.suppressed.exp
1>C:\Coding\Engine\Plugins\Runtime\ResonanceAudio\Binaries\Win64\UE4Editor-ResonanceAudio.dll : fatal error LNK1169: one or more multiply defined symbols found
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command “…\Build\BatchFiles\Build.bat -Target=“UE4Editor Win64 Development” -Target=“ShaderCompileWorker Win64 Development” -WaitMutex -FromMsBuild” exited with code 5. Please verify that you have sufficient rights to run this command.
1>Done building project “UE4.vcxproj” – FAILED.
Error LNK2005 main already defined in Module.ResonanceAudio.cpp.obj UE4 C:\Coding\Engine\Intermediate\ProjectFiles\CMakeCCompilerId.c.obj 1
Error LNK2005 main already defined in Module.ResonanceAudio.cpp.obj UE4 C:\Coding\Engine\Intermediate\ProjectFiles\main.c.obj 1
Error LNK1169 one or more multiply defined symbols found UE4 C:\Coding\Engine\Plugins\Runtime\ResonanceAudio\Binaries\Win64\UE4Editor-ResonanceAudio.dll 1
Error MSB3075 The command “…\Build\BatchFiles\Build.bat -Target=“UE4Editor Win64 Development” -Target=“ShaderCompileWorker Win64 Development” -WaitMutex -FromMsBuild” exited with code 5. Please verify that you have sufficient rights to run this command. UE4 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 44
I have this issue too. I just removed Windows from the WhitelistPlatforms in ResonanceAudio.uplugin so I’m not building it and I can use the engine now. Of course if I was planning on using this that’d not be great, so just a hack to move forward.
Those CMake source files (e.g. CMakeCCompilerId) are used by CMake to perform some diagnostics in the process of creating build files, they really shouldn’t be getting ingested into producing that UE4Editor-ResonanceAudio.dll. UnrealBuildTool, during some step of its execution, will hunt through project subdirectories and vacuum up .cpp files when determining which objects to compile and link into libraries, and it’s doing this for the ResonanceAudio plugin. Make sure that these source files (e.g. CMakeCCompilerId.cpp) are removed before the build tool runs. I did this and it built fine. Probably these source files shouldn’t be checked in, or should be ignored as part of the build if they’re appearing because of CMake running.
@exitlights2 and @kevinleit seem to be correct. This is the only solution I have found. The ResonanceAudio SDK for Unreal seems to be maintained by Unreal and there is no documentation on how to compile it separately. However, the documentation and repositories exist for other platforms.
I remove a “out/build” directory somewhere in Engine\Plugins\Runtime\ResonanceAudio\Source\ResonanceAudio\Private\ResonanceAudioLibrary.
Built UE4 it again, and link without error.
(don’t know from where these folder came from)
Also, solution of removing “Windows” of WhitelistPlatforms work, but not ideal
This worked on Windows 10 as well by removing the “out/build” directory, which is at Engine\Plugins\Runtime\ResonanceAudio\Source\ResonanceAudio\Private\ResonanceAudioLibrary\resonance_audio
Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command “…..\Build\BatchFiles\Build.bat -Target=“UnrealEditor Win64 Development” -Target=“ShaderCompileWorker Win64 Development -Quiet” -WaitMutex -FromMsBuild” exited with code 6.
3>Done building project “UE5.vcxproj” – FAILED.
I have this error. Kindly help me to solve this issue.
Thanks.