Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build SocketIO - 'WITH_OPUS' macro redefined #441

Open
t0msk opened this issue Sep 26, 2024 · 3 comments
Open

Cannot build SocketIO - 'WITH_OPUS' macro redefined #441

t0msk opened this issue Sep 26, 2024 · 3 comments

Comments

@t0msk
Copy link

t0msk commented Sep 26, 2024

I use Unreal Engine 5.4 and SocketIO 2.8 for 5.4 version but when I try to build project I get:


[2/37] Compile CUBlueprintLibrary.cpp
In file included from /run/media/tomsk/Data/Projects/Unreal/socketio/Plugins/SocketIOClient/Source/CoreUtility/Private/CUBlueprintLibrary.cpp:23:
/run/media/tomsk/Data/Projects/Unreal/socketio/Plugins/SocketIOClient/Source/CoreUtility/Public/CUOpusCoder.h:7:9: error: 'WITH_OPUS' macro redefined [-Werror,-Wmacro-redefined]
#define WITH_OPUS (PLATFORM_WINDOWS || PLATFORM_UNIX || PLATFORM_ANDROID)
        ^
/run/media/tomsk/Data/Projects/Unreal/socketio/Plugins/SocketIOClient/Intermediate/Build/Linux/x64/UnrealEditor/Development/CoreUtility/Definitions.CoreUtility.h:19:9: note: previous definition is here
#define WITH_OPUS 1
        ^
1 error generated.
@progress 'Compiling C++ source code...' 8%
@progress 'Compiling C++ source code...' 11%
[3/37] Compile CUFileSubsystem.cpp
@progress 'Compiling C++ source code...' 14%
[4/37] Compile CUFileComponent.cpp
@progress 'Compiling C++ source code...' 16%
[5/37] Compile CUMeasureTimer.cpp
@progress 'Compiling C++ source code...' 19%
[6/37] Compile SharedPCH.Engine.Project.RTTI.ValApi.Cpp20.h
[7/37] Compile CUOpusCoder.cpp
In file included from /run/media/tomsk/Data/Projects/Unreal/socketio/Plugins/SocketIOClient/Source/CoreUtility/Private/CUOpusCoder.cpp:1:
/run/media/tomsk/Data/Projects/Unreal/socketio/Plugins/SocketIOClient/Source/CoreUtility/Public/CUOpusCoder.h:7:9: error: 'WITH_OPUS' macro redefined [-Werror,-Wmacro-redefined]
#define WITH_OPUS (PLATFORM_WINDOWS || PLATFORM_UNIX || PLATFORM_ANDROID)
        ^
/run/media/tomsk/Data/Projects/Unreal/socketio/Plugins/SocketIOClient/Intermediate/Build/Linux/x64/UnrealEditor/Development/CoreUtility/Definitions.CoreUtility.h:19:9: note: previous definition is here
#define WITH_OPUS 1
        ^
1 error generat
@noahlacour
Copy link

Same thing for me, specifically using the unreal build tool for plugins in Linux OS trying to fix the file gives other errors

@foranie
Copy link

foranie commented Oct 16, 2024

I came in because of this problem too.

@JNANEU
Copy link

JNANEU commented Oct 17, 2024

The problem occurs when the project is built for platforms other than Windows. The reason is to use the OpusAudioDecoder module which has a default definition of 1 module config: PublicDefinitions.Add("WITH_OPUS=1");. Which in turn, during the rebuild, adds the following definition to the Intermediate folder along the path: Plugins/SocketIOClient/Intermediate/Build/Android/a/UnrealGame/Shipping/CoreUtility/Definitions.CoreUtility.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants