Error on build (missing header files)
ger-benjamin opened this issue · 7 comments
Hi everyone,
I'm wanted to try unity-cesium. I first tried to install the Cesium-Unity from the package-manager of unity, but I had compilation error.
So I've tried to build this project myself... without success. It says I miss some headers file.
I'm on a debian based sytsem (Pop!_OS), so ~Ubuntu 22.04
, with cmake version 3.22.1
, dotnet version 8.0.204
I've followed https://github.com/CesiumGS/cesium-unity/blob/main/Documentation~/developer-setup.md
And I had no error before this commande:
cmake --build build -j14 --target install --config Debug
During this operation, I've error like:
In file included from /home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/CesiumEditorWindowImpl.cpp:1:
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/CesiumEditorWindowImpl.h:3:10: fatal error: DotNet/CesiumForUnity/Cesium3DTileset.h: No such file or directory
3 | #include <DotNet/CesiumForUnity/Cesium3DTileset.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
And here's the build stacktrace (3th execution, same errors but smaller that the first on successful part).
cmake --build build -j14 --target install --config Debug
[ 2%] Built target uriparser
[ 2%] Built target Async++
[ 2%] Built target sqlite3
[ 5%] Built target s2geometry
[ 8%] Built target zlibstatic
[ 9%] Built target libjpeg-turbo
[ 12%] Built target webputils
[ 13%] Built target webputilsdecode
[ 17%] Built target astcenc-avx2-static
[ 18%] Built target spdlog
[ 22%] Built target webpdspdecode
[ 22%] Built target ktx_version
[ 25%] Built target sharpyuv
[ 25%] Built target webpdecode
[ 29%] Built target webpdsp
[ 29%] Built target draco_attributes
[ 29%] Built target draco_points_enc
[ 32%] Built target webpencode
[ 32%] Built target draco_compression_attributes_pred_schemes_enc
[ 33%] Built target draco_compression_attributes_dec
[ 35%] Built target draco_compression_attributes_enc
[ 36%] Built target draco_compression_bit_coders
[ 36%] Built target draco_compression_decode
[ 36%] Built target draco_compression_encode
[ 37%] Built target draco_compression_entropy
[ 37%] Built target draco_compression_options
[ 37%] Built target draco_compression_mesh_dec
[ 40%] Built target draco_core
[ 41%] Built target draco_compression_mesh_enc
[ 41%] Built target draco_compression_point_cloud_dec
[ 41%] Built target draco_metadata_dec
[ 43%] Built target draco_mesh
[ 45%] Built target draco_io
[ 45%] Built target draco_compression_point_cloud_enc
[ 45%] Built target draco_metadata_enc
[ 45%] Built target draco_animation_enc
[ 47%] Built target draco_animation_dec
[ 47%] Built target draco_animation
[ 48%] Built target draco_metadata
[ 48%] Built target draco_point_cloud
[ 51%] Built target meshoptimizer
[ 50%] Built target draco_points_dec
[ 51%] Built target modp_b64
[ 51%] Built target tinyxml2
[ 55%] Built target tidy-static
[ 55%] Built target csprng
[ 55%] Built target webpdecoder
[ 55%] Built target webp
[ 56%] Built target draco_static
[ 58%] Built target CesiumUtility
[ 66%] Built target ktx
[ 66%] Built target Cesium3DTiles
[ 67%] Built target CesiumJsonWriter
[ 68%] Built target CesiumJsonReader
[ 70%] Built target CesiumAsync
[ 72%] Built target CesiumGeometry
[ 75%] Built target CesiumGltf
[ 75%] Built target Cesium3DTilesReader
[ 77%] Built target CesiumIonClient
[ 79%] Built target CesiumGeospatial
[ 81%] Built target CesiumGltfReader
[ 82%] Building CXX object Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/CesiumEditorWindowImpl.cpp.o
[ 82%] Building CXX object Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/__/Shared/src/UnityAssetAccessor.cpp.o
[ 82%] Building CXX object Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/CesiumIonSessionImpl.cpp.o
[ 82%] Building CXX object Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/__/Shared/src/UnityTaskProcessor.cpp.o
[ 82%] Building CXX object Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/IonAssetsTreeViewImpl.cpp.o
[ 82%] Building CXX object Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/__/Shared/src/UnityLoggerSink.cpp.o
[ 82%] Building CXX object Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/UnityExternals.cpp.o
[ 82%] Building CXX object Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/IonTokenTroubleshootingWindowImpl.cpp.o
Consolidate compiler generated dependencies of target CesiumGltfContent
[ 82%] Building CXX object Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/SelectIonTokenWindowImpl.cpp.o
In file included from /home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/IonTokenTroubleshootingWindowImpl.cpp:1:
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/IonTokenTroubleshootingWindowImpl.h:3:10: fatal error: DotNet/System/String.h: No such file or directory
3 | #include <DotNet/System/String.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/CesiumEditorWindowImpl.cpp:1:
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/CesiumEditorWindowImpl.h:3:10: fatal error: DotNet/CesiumForUnity/Cesium3DTileset.h: No such file or directory
3 | #include <DotNet/CesiumForUnity/Cesium3DTileset.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/build.make:188: Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/IonTokenTroubleshootingWindowImpl.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: *** [Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/build.make:146: Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/CesiumEditorWindowImpl.cpp.o] Error 1
[ 83%] Built target CesiumGltfContent
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Shared/src/UnityTaskProcessor.cpp:3:10: fatal error: DotNet/System/Action.h: No such file or directory
3 | #include <DotNet/System/Action.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[ 83%] Building CXX object extern/cesium-native/CesiumQuantizedMeshTerrain/CMakeFiles/CesiumQuantizedMeshTerrain.dir/generated/src/LayerJsonWriter.cpp.o
[ 83%] Building CXX object extern/cesium-native/CesiumQuantizedMeshTerrain/CMakeFiles/CesiumQuantizedMeshTerrain.dir/generated/src/registerWriterExtensions.cpp.o
In file included from /home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/IonAssetsTreeViewImpl.cpp:1:
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/IonAssetsTreeViewImpl.h:5:10: fatal error: DotNet/CesiumForUnity/IonAssetsColumn.h: No such file or directory
5 | #include <DotNet/CesiumForUnity/IonAssetsColumn.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[ 83%] Building CXX object extern/cesium-native/CesiumQuantizedMeshTerrain/CMakeFiles/CesiumQuantizedMeshTerrain.dir/generated/src/GeneratedJsonHandlers.cpp.o
[ 83%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/B3dmToGltfConverter.cpp.o
gmake[2]: *** [Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/build.make:174: Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/IonAssetsTreeViewImpl.cpp.o] Error 1
[ 83%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/BingMapsRasterOverlay.cpp.o
[ 83%] Building CXX object extern/cesium-native/CesiumQuantizedMeshTerrain/CMakeFiles/CesiumQuantizedMeshTerrain.dir/generated/src/registerReaderExtensions.cpp.o
gmake[2]: *** [Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/build.make:132: Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/__/Shared/src/UnityTaskProcessor.cpp.o] Error 1
[ 83%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/BatchTableHierarchyPropertyValues.cpp.o
[ 85%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/BatchTableToGltfStructuralMetadata.cpp.o
[ 85%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/DebugColorizeTilesRasterOverlay.cpp.o
In file included from /home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/CesiumIonSessionImpl.cpp:1:
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/CesiumIonSessionImpl.h:12:10: fatal error: DotNet/System/Collections/Generic/List1.h: No such file or directory
12 | #include <DotNet/System/Collections/Generic/List1.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/build.make:160: Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/CesiumIonSessionImpl.cpp.o] Error 1
[ 85%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/IonRasterOverlay.cpp.o
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/UnityExternals.cpp:10:10: fatal error: DotNet/CesiumForUnity/CesiumRuntimeSettings.h: No such file or directory
10 | #include <DotNet/CesiumForUnity/CesiumRuntimeSettings.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/build.make:230: Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/UnityExternals.cpp.o] Error 1
[ 85%] Building CXX object extern/cesium-native/CesiumQuantizedMeshTerrain/CMakeFiles/CesiumQuantizedMeshTerrain.dir/src/Layer.cpp.o
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Shared/src/UnityLoggerSink.cpp:3:10: fatal error: DotNet/System/Object.h: No such file or directory
3 | #include <DotNet/System/Object.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Shared/src/UnityAssetAccessor.cpp:8:10: fatal error: DotNet/CesiumForUnity/Helpers.h: No such file or directory
8 | #include <DotNet/CesiumForUnity/Helpers.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/build.make:118: Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/__/Shared/src/UnityLoggerSink.cpp.o] Error 1
gmake[2]: *** [Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/build.make:104: Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/__/Shared/src/UnityAssetAccessor.cpp.o] Error 1
[ 85%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/BinaryToGltfConverter.cpp.o
[ 85%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/QuadtreeRasterOverlayTileProvider.cpp.o
In file included from /home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/SelectIonTokenWindowImpl.cpp:1:
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Editor/src/SelectIonTokenWindowImpl.h:6:10: fatal error: DotNet/CesiumForUnity/IonTokenSource.h: No such file or directory
6 | #include <DotNet/CesiumForUnity/IonTokenSource.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/build.make:216: Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/src/SelectIonTokenWindowImpl.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:4319: Editor/CMakeFiles/CesiumForUnityNative-Editor.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 85%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/CmptToGltfConverter.cpp.o
[ 86%] Building CXX object extern/cesium-native/CesiumQuantizedMeshTerrain/CMakeFiles/CesiumQuantizedMeshTerrain.dir/src/QuantizedMeshLoader.cpp.o
[ 86%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/GltfConverters.cpp.o
[ 86%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/ImplicitTilingUtilities.cpp.o
[ 86%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/PntsToGltfConverter.cpp.o
[ 86%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/SubtreeAvailability.cpp.o
[ 86%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/RasterOverlay.cpp.o
[ 86%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/RasterOverlayDetails.cpp.o
[ 86%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/TileBoundingVolumes.cpp.o
[ 86%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/TileTransform.cpp.o
[ 87%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/RasterOverlayTile.cpp.o
[ 87%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/RasterOverlayTileProvider.cpp.o
[ 87%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/RasterOverlayUtilities.cpp.o
[ 87%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/RasterizedPolygonsOverlay.cpp.o
[ 87%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/TileMapServiceRasterOverlay.cpp.o
[ 87%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/WebMapServiceRasterOverlay.cpp.o
[ 89%] Building CXX object extern/cesium-native/Cesium3DTilesContent/CMakeFiles/Cesium3DTilesContent.dir/src/registerAllTileContentTypes.cpp.o
[ 89%] Building CXX object extern/cesium-native/CesiumRasterOverlays/CMakeFiles/CesiumRasterOverlays.dir/src/WebMapTileServiceRasterOverlay.cpp.o
[ 89%] Linking CXX static library libCesiumQuantizedMeshTerraind.a
[ 89%] Built target CesiumQuantizedMeshTerrain
[ 89%] Linking CXX static library libCesium3DTilesContentd.a
[ 89%] Built target Cesium3DTilesContent
[ 89%] Linking CXX static library libCesiumRasterOverlaysd.a
[ 89%] Built target CesiumRasterOverlays
gmake: *** [Makefile:156: all] Error 2
Any idea ?
Thanks in advance :-)
Those files should be generated when the C# code is compiled. Make sure you followed the instructions exactly. A common mistake is to forget to build Reinterop before opening the project in Unity, at which point Unity will (annoyingly) delete the .meta file associated with the Reinterop.dll. After that, building Reinterop won't help, because the now deleted .meta file told Unity how to use it properly. You'll need to build Reinterop, restore that file from git, let Unity compile the plugin source files, and then you can compile the C++ code.
This is all very complicated though. It's probably much easier to fix whatever compilation problem you had with the pre-built version.
I'm going to close this because there's nothing actionable on our side. If you're still having trouble, please post to the community forum.
I build the Reinterop part without issue I think...
I'll try again, maybe take a closer look to the logs, or re-try the pre-built version.
I understand that you close it. Let see if other people will re-open it.
Thanks, and have a nice day.
I build the Reinterop part without issue I think...
Did you do that before opening the project in Unity for the first time, though?
In any case, if files like DotNet/System/String.h
are missing, it means the code generation that runs as part of the C# compilation didn't happen or didn't work. So open Unity back up, let it compile your project, and see if there are any errors in the console.
Did you do that before opening the project in Unity for the first time, though?
Well, unity was running, but this cesium-unity project was NOT loaded in unity. Cesium-unity was (and still is) in a new folder, not currently linked anywhere.
I've wanted to try to load it after the "Build for the Editor" part.
Now you mention it, I've skipped the first line of this section, as it says it will leads to error:
To start the Cesium for Unity build process, open the cesium-unity-samples project in the Unity Editor.
So, I'll try to load it first, and then run the build commands.
Yes ok, it's better now.
Then I had these kind of errors:
[ 97%] Building CXX object Runtime/CMakeFiles/CesiumForUnityNative-Runtime.dir/src/CesiumRasterOverlayUtility.cpp.o
In file included from /home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Runtime/src/CesiumPropertyTablePropertyImpl.cpp:3:
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Runtime/src/CesiumPropertyTablePropertyImpl.h:53:7: error: ‘std::int64_t’ has not been declared
53 | std::int64_t featureID,
| ^~~
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Runtime/src/CesiumPropertyTablePropertyImpl.h:56:8: error: ‘int8_t’ in namespace ‘std’ does not name a type
56 | std::int8_t GetSByte(
| ^~~~~~
/home/xxx/Documents/git/unity-cesium/cesium-unity-samples/Packages/com.cesium.unity/native~/Runtime/src/CesiumPropertyTablePropertyImpl.h:61:8: error: ‘uint8_t’ in namespace ‘std’ does not name a type
61 | std::uint8_t GetByte(
| ^~~~~~~
etc...
...
But adding #include <cstdint>
in cesium-unity-samples/Packages/com.cesium.unity/native~/Runtime/src/CesiumPropertyTablePropertyImpl.h
solves this last issue.
I think this last issue was due to my version of c++...
Anyway, it's fully working now.
Again, sorry for the noise, the error was "me misreading the doc".
And thanks for the (very quick) help.