CesiumGS / cesium-unreal

Bringing the 3D geospatial ecosystem to Unreal Engine
https://cesium.com/platform/cesium-for-unreal/
Apache License 2.0
885 stars 286 forks source link

Linker error when packaging when the Cesium and Pixel Streaming plugins are both enabled #1420

Closed alingkumo closed 1 month ago

alingkumo commented 2 months ago

Hello everyone, When i use both Pixelstreaming and CesiumForUnreal, when I packing the project,the problem happened!! I found a similar problem in https://github.com/CesiumGS/cesium-native/commit/cd67f6f4094324414fd416fec8d5c837cdc75287, should the native update or ?

webrtc.lib(numbers.obj) : error LNK2005: "char __cdecl absl::numbers_internal::FastIntToBuffer(unsigned int,char )" (?FastIntToBuffer@numbers_internal@absl@@YAPEADIPEAD@Z) already defined in s2geometry.lib(numbers.obj) UATHelper: Packaging (Windows): webrtc.lib(numbers.obj) : error LNK2005: "char __cdecl absl::numbers_internal::FastIntToBuffer(int,char )" (?FastIntToBuffer@numbers_internal@absl@@YAPEADHPEAD@Z) already defined in s2geometry.lib(numbers.obj) UATHelper: Packaging (Windows): webrtc.lib(numbers.obj) : error LNK2005: "char __cdecl absl::numbers_internal::FastIntToBuffer(unsigned __int64,char )" (?FastIntToBuffer@numbers_internal@absl@@YAPEAD_KPEAD@Z) already defined in s2geometry.lib(numbers.obj) UATHelper: Packaging (Windows): webrtc.lib(numbers.obj) : error LNK2005: "char __cdecl absl::numbers_internal::FastIntToBuffer(__int64,char )" (?FastIntToBuffer@numbers_internal@absl@@YAPEAD_JPEAD@Z) already defined in s2geometry.lib(numbers.obj) UATHelper: Packaging (Windows): webrtc.lib(numbers.obj) : error LNK2005: "unsigned int64 cdecl absl::numbers_internal::SixDigitsToBuffer(double,char *)" (?SixDigitsToBuffer@numbers_internal@absl@@YA_KNPEAD@Z) already defined in s2geometry.lib(numbers.obj) UATHelper: Packaging (Windows): Creating library D:\Code\ESDemoCPP\Binaries\Win64\ESDemoCPP-Win64-Shipping.lib and object D:\Code\ESDemoCPP\Binaries\Win64\ESDemoCPP-Win64-Shipping.exp UATHelper: Packaging (Windows): D:\Code\ESDemoCPP\Binaries\Win64\ESDemoCPP-Win64-Shipping.exe : fatal error LNK1169: one or more multiply defined symbols found

alingkumo commented 2 months ago

PixelStreaming use WebRTC, then WebRTC use link to webtrc.lib

kring commented 2 months ago

Looks like both WebRTC and S2Geometry link parts of Abseil into themselves statically. This is going to be very tricky to solve.

Immersiv-1 commented 1 month ago

Hi @alingkumo, did you find a workaround for this issue? Thanks

alingkumo commented 1 month ago

@Immersiv-1 I just change the absl namespace to others, and recompile s2geometry in the cesium native, that can work but not the best solution.

kring commented 1 month ago

Yeah that's a good idea @alingkumo. We'll probably have to do something similar to fix it in the shipped version of Cesium for Unreal.