CesiumGS / cesium-unreal

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

Can't build CesiumGltf.lib when I cmake for cesium-native #1470

Closed Giannuo closed 3 days ago

Giannuo commented 4 days ago

when I exec "cmake --build build --config Release --target install" , No 'CesiumGltf.lib' build under 'extern\build\cesium-native\CesiumGltf\Release' 捕获111

And No 'cesium-unreal-samples\plugins\cesium-unreal\Source\ThirdParty' was created,that means it build failed ?

because of above, I can't BuildPlugin with UE 'RunUAT.bat' 捕获222

what am i supposed to do ?

ENV: Unreal Engine 5.2.1 cesium-unreal main branch cesium-native main branch cmake version 3.20.21032501-MSVC_2 visual studio 2019

kring commented 3 days ago

Sounds like it must have failed. I'd have to see the entirety of the cmake output to take a guess what might have gone wrong.

kring commented 3 days ago

Oh I just noticed you're using VS 2019 and cmake 3.20. I'd recommend upgrading both (to VS2022 and cmake 3.30).

Giannuo commented 3 days ago

捕获333 thanks! I just change the files to utf-8 bom which were got error above when I cmake build ,such as 'cesium-native\CesiumGltf\ClassProperty.h' and other several files redo build ,and it works for me

Giannuo commented 3 days ago

similar to "https://github.com/CesiumGS/cesium-unreal/issues/997"

kring commented 3 days ago

I think that telling MSVC that the files are UTF-8 should work as well: https://learn.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170

MSVC's default seems crazy here:

By default, Visual Studio detects a byte-order mark to determine if the source file is in an encoded Unicode format, for example, UTF-16 or UTF-8. If no byte-order mark is found, it assumes that the source file is encoded in the current user code page, unless you've specified a code page by using /utf-8 or the /source-charset option.

In any case, I don't think there's any action for cesium-unreal here, so I'm going to close this.