AgoraIO-Extensions / Agora-Unreal-RTC-SDK

MIT License
37 stars 14 forks source link

Failing to compile Agora plugin when building UE5.2 linux server #93

Closed Codes97 closed 6 months ago

Codes97 commented 8 months ago

Hi, a lot of linker errors appear when I try to build an UE 5.2 Linux server using the Agora Plugin using Clang 21.

UATHelper: Packaging (Linux): clang++: error: linker command failed with exit code 1 (use -v to see invocation) PackagingResults: Error: undefined symbol: agora::rtc::ue::RtcEngineProxy::startScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE, agora::rtc::ScreenCaptureConfiguration const&) PackagingResults: Error: undefined symbol: agora::rtc::ue::RtcEngineProxy::stopScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE) PackagingResults: Error: undefined symbol: getMediaPlayerCacheManager PackagingResults: Error: undefined symbol: createAgoraRtcEngine PackagingResults: Error: linker command failed with exit code 1 (use -v to see invocation) PackagingResults: Error: undefined symbol: agora::rtc::ue::RtcEngineProxy::startScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE, agora::rtc::ScreenCaptureConfiguration const&) PackagingResults: Error: undefined symbol: agora::rtc::ue::RtcEngineProxy::stopScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE) PackagingResults: Error: undefined symbol: getMediaPlayerCacheManager PackagingResults: Error: undefined symbol: createAgoraRtcEngine PackagingResults: Error: linker command failed with exit code 1 (use -v to see invocation) PackagingResults: Error: undefined symbol: agora::rtc::ue::RtcEngineProxy::startScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE, agora::rtc::ScreenCaptureConfiguration const&) PackagingResults: Error: undefined symbol: agora::rtc::ue::RtcEngineProxy::stopScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE) PackagingResults: Error: undefined symbol: getMediaPlayerCacheManager PackagingResults: Error: undefined symbol: createAgoraRtcEngine PackagingResults: Error: linker command failed with exit code 1 (use -v to see invocation) PackagingResults: Error: undefined symbol: agora::rtc::ue::RtcEngineProxy::startScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE, agora::rtc::ScreenCaptureConfiguration const&) PackagingResults: Error: undefined symbol: agora::rtc::ue::RtcEngineProxy::stopScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE) PackagingResults: Error: undefined symbol: getMediaPlayerCacheManager PackagingResults: Error: undefined symbol: createAgoraRtcEngine PackagingResults: Error: linker command failed with exit code 1 (use -v to see invocation) PackagingResults: Error: undefined symbol: agora::rtc::ue::RtcEngineProxy::startScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE, agora::rtc::ScreenCaptureConfiguration const&) PackagingResults: Error: undefined symbol: agora::rtc::ue::RtcEngineProxy::stopScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE) PackagingResults: Error: undefined symbol: getMediaPlayerCacheManager PackagingResults: Error: undefined symbol: createAgoraRtcEngine PackagingResults: Error: linker command failed with exit code 1 (use -v to see invocation) UATHelper: Packaging (Linux): ld.lld: error: undefined symbol: agora::rtc::ue::RtcEngineProxy::startScreenCapture(agora::rtc::VIDEO_SOURCE_TYPE, agora::rtc::ScreenCaptureConfiguration const&)

HereafterMills commented 7 months ago

Hi, did you manage to solve for this?

WinterPu commented 7 months ago

Sorry, currently, we don't have any plans to support the Linux platform on Unreal for regular versions.

However, you may contact sales to make a special request for a supported one based on a specific version.. Ref: https://www.agora.io/en/talk-to-us/

HereafterMills commented 7 months ago

Hi, im not asking Agora to support Linux. I am asking you to make certain changes to this plugin/sdk such that:

If Linux: Dont bother with anything and skip all SDK stuff, but let the exposed nodes remain (without functionality) so blueprints dont break.

This is because currently, the only way to build a linux server for an app that uses agora is to explicitly have separate branches, one with agora and one without. It seems like a rather extensive requirement simply to support agora. There are plenty of other plugins that dont support a particular operating system, but are able to circumvent the need to complicate the workflow as they want apps that use their plugins to support cross platform play.

Additionally, having a linux server should be a standard requirement for most non-p2p games. I cant imagine this issue helps adaptability within the indie-game makers ecosystem with agora, specially since its so much more useful than Vivox and the only barrier is the SDK.

Sorry, that was a mouthful, but was my two cents. Personally, i can get past the issue with my own fix, but it just seems like quite a sad situation. Specially since iv grown to like the Agora platform so much.

WinterPu commented 7 months ago

If you simply want to ensure successful compilation, I would recommend disabling the plugin on your Linux server target.

public class LinuxServerTarget : TargetRules
{
    public LinuxServerTarget(TargetInfo Target) : base(Target)
    {
        // ...
                BuildEnvironment = TargetBuildEnvironment.Unique;
                DisablePlugins.Add("AgoraPlugin");
        // ...
    }
}

BTW, thanks for the explanation.

HereafterMills commented 7 months ago

This helps. Though i wonder if this might break all the blueprint nodes though.

WinterPu commented 7 months ago

The plugin itself won't be included in the compilation after making that setting. If you are using BP in your project, you need to separate it from your non-server code.

HereafterMills commented 7 months ago

Just leaving a note here, this advice worked fantastically. Additionally, i removed the plugin from the uproject and set it as a conditional private dependency within the build.cs. Also, my implementation of Agora is in my gameinstance, so switching it out with an agora-less one when building linux. Nicely fits into my deployment pipeline too.