CesiumNative compiling c++ code with Error C1083

My goal is to compile the CesiumNative source code for use in Unity, but I’m encountering some compilation issues.

Procedure reference: [cesium-unity/Documentation~/developer-setup.md at main · CesiumGS/cesium-unity · GitHub](https://github.com/CesiumGS/cesium-

When i do “cmake --build build -j14 --target install --config Debug”

Some log of Error:

m-native\extern\draco\src\draco/compression/attributes/sequential_normal_attribute_decoder.h(20,10): fatal  error C1083
: 无法打开包括文件: “draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_decoding
_transform.h”: No such file or directory [C:\Users\xxx\GitLab\CesiumNativeUnityDevelop\cesium-unity-samples\Pack
m-native\extern\draco\src\draco/compression/attributes/sequential_normal_attribute_encoder.h(20,10): fatal  error C1083
: 无法打开包括文件: “draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_encoding
_transform.h”: No such file or directory [C:\Users\xxx\GitLab\CesiumNativeUnityDevelop\cesium-unity-samples\Pack

Measures I’ve tried:

  1. Oddly enough, when compiling in other locally folders , there is no such issue,when i move files to other path,this error happened.
  2. I check the error file “sequential_normal_attribute_encoder.h” in that path ,this file exists,all of error file is exist.
  3. I clean the “…~native\build”,delet the “…~native\build”, it doesn’t work
  4. I’ve done " Maximum Path Length Limitation.";
  5. I’ve done dotnet publish Reinterop~ -o .
  6. I’ve done cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug

Any one can help me?Thank u very much~

Those errors are usually caused by your path being too long. You’ll probably see errors to this effect earlier in the CMake log.

As mentioned in the Prerequisites section of the Developer Setup instructions, you must enable Long Paths on Windows.

Even then, you might find that C:\Users\xxx\GitLab\CesiumNativeUnityDevelop\cesium-unity-samples is too long a path. Move cesium-unity-samples somewhere with a shorter path and you should have more success.

This is unfortunately a limitation of Windows and various tools running on Windows, and not something we can fix in Cesium for Unity.

Thank u so much! I just compiled successfully. This question has been bothering me for days.

In order to verify the maximum path:

  • I checked the Long Paths on Windows, I am sure LongPathsEnabled value is 1;
  • I check the windows path that successful compiled is ...\CesiumUnityDeveloper\..., the failed windows path is ...\CesiumNativeUnityDevelop\...

so I modify the path, it compiled success.
Perhaps successful paths are already the maximum of LongPaths.

I have one more question (some warning):
when i do cmake --build build -j14 --target install --config Debug, some yellow alarms appeared, such as

tive\extern\draco\src\draco/compression/attributes/normal_compression_utils.h(1,1): warning C4819: 该文件包含不能在当前 代码页(936)中表
示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
[The file contains tables that cannot be found on the current code page (936).
Shown characters. Please save the file in Unicode format to prevent data loss ]

Does non-Unicode format have a serious impact? Does it make a difference if Idon’t fix this issue

Glad to hear you got it working!

I don’t think that warning should cause problems. It’s most likely referring to the use of this fancy quote character (“) in some comments:

Since it’s a comment, it shouldn’t make any functional difference. If it bothers you, it could be reported to the Draco project.