DirectX12GameEngine
DirectX12GameEngine copied to clipboard
Cannot Build Gltf
Hi,
Not sure what I am doing wrong, but cannot build Gltf.
Severity | Code | Description |
---|---|---|
Error | CS0234 | The type or namespace name 'Schema' does not exist in the namespace 'GltfLoader' (are you missing an assembly reference?) |
Error | CS0234 | The type or namespace name 'Schema' does not exist in the namespace 'GltfLoader' (are you missing an assembly reference?) |
Error | CS0246 | The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Schema' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Schema' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) |
Error | CS0246 | The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) |
Cheers,
Ander
Did you init submodules?
I am thinking no, but am not sure how.
I have just Googled it and am still a bit mystified. Sorry mate.
I guess this should be all you have to do before opening the solution
git clone https://github.com/Aminator/DirectX12GameEngine --recursive
cd DirectX12GameEngine
cd Gltf\GltfGenerator
dotnet build
cd ..\GltfLoader
dotnet build
Hi, Thanks so much for your help with this : )
But still no dice;
ander@DESKTOP-630APCD MINGW64 ~/DirectX12GameEngine/Gltf/GltfLoader (master) $ dotnet build Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 343.11 ms for C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj. Restore completed in 394.15 ms for C:\Users\ander\DirectX12GameEngine\Gltf\GltfGenerator\GltfGenerator.csproj. GltfGenerator -> C:\Users\ander\DirectX12GameEngine\Gltf\GltfGenerator\bin\Debug\netstandard2.0\GltfGenerator.dll Interface.cs(8,18): error CS0234: The type or namespace name 'Schema' does not exist in the namespace 'GltfLoader' (are you missing an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(30,33): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(43,33): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(166,52): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(201,52): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(178,49): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(251,49): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(217,66): error CS0246: The type or namespace name 'Schema' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(226,57): error CS0246: The type or namespace name 'Schema' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(271,49): error CS0246: The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(287,33): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(297,50): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(307,43): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(318,43): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(332,49): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(344,49): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(356,49): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(416,55): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(430,55): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj]
Build FAILED.
Interface.cs(8,18): error CS0234: The type or namespace name 'Schema' does not exist in the namespace 'GltfLoader' (are you missing an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(30,33): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(43,33): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(166,52): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(201,52): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(178,49): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(251,49): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(217,66): error CS0246: The type or namespace name 'Schema' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(226,57): error CS0246: The type or namespace name 'Schema' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(271,49): error CS0246: The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(287,33): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(297,50): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(307,43): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(318,43): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(332,49): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(344,49): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(356,49): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(416,55): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] Interface.cs(430,55): error CS0246: The type or namespace name 'Gltf' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\ander\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj] 0 Warning(s) 19 Error(s)
I must be missing something.
Cheers,
Ander
Oh I guess it's because of this https://github.com/Aminator/DirectX12GameEngine/commit/54e7b42152d5b3d9252022815aa9d89203df23d9 it now uses new Source Generator @Aminator
You need to use the latest .NET 5 SDK and Visual Studio Preview to build successfully. Since source generators are still in preview, Visual Studio will still show compile errors.
Thank you both : )
Ander
Hi Guys,
Sorry, but still having the issue;
C:\Users\ander\source\repos\DirectX12GameEngine\Gltf\GltfLoader>dotnet build Microsoft (R) Build Engine version 16.6.0-preview-20181-02+9f3e4e725 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Determining projects to restore... Restored C:\Users\ander\source\repos\DirectX12GameEngine\Gltf\GltfLoader\GltfLoader.csproj (in 216 ms). 1 of 2 projects are up-to-date for restore. You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview GltfGenerator -> C:\Users\ander\source\repos\DirectX12GameEngine\Gltf\GltfGenerator\bin\Debug\netstandard2.0\GltfGenerator.dll Same errors as before, I am using Preview and have installed the latest .NET 5 SDK.
Cheers,
Ander
A trick I found was making any change to GltfSourceGenerator.cs
file, even just a white space change, and then building again. Like I said, this feature is still in preview, so expect some hiccups.
Thanks mate : ) Got it to build even though it still shows errors in the IDE.
Adding a single space to GltfSourceGenerator is not helping. It still fails with
Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Microsoft.CodeAnalysis.CommonCompiler.CreateAnalyzerConfigOptionsProvider(IEnumerable`1 syntaxTrees, ImmutableArray`1 sourceFileAnalyzerConfigOptions, ImmutableArray`1 additionalFiles, ImmutableArray`1 additionalFileOptions)
Very buggy compiler feature for now. Is there a "stable" version before 54e7b42 ?
I also had some trouble with building this but got around it by updating to the latest Visual Studio Preview and doing a rain dance. We can't expect a problem-free experience using the latest previews.
To get around the pain I configured most of these projects to produce a NuGet package on build, and then I simply copied those to my local NuGet cache, and referenced them from my own consuming project to avoid having do deal with this issue once I successfully built the project once.
Is there any interest to publish one or more NuGet packages containing these dlls to nuget.org?
First off I really like this project. I did a git on it many months ago before there was changes and it compiled fine so I decided to upgrade and now it won't build as is
(is there any backup you can put up in a different repo?). I have been porting this engine off to 4.7.2 framework for my project client (because my project client is done in 4.7.2 Framework and has old Axiom) I made new project files. By the way If you want to see my project you can get here on GitHub.
I had the issue here but I did the following modifications to Gltf
since I also have that source. I added the program.cs
from the glTF source to the build with the following minor modification where original code had to many directories back from \bin\Debug
BUT if using 86/64
build then you may need to adjust that depending on how you configure the build will depend on if you need to change the path. Also added on successful compile to execute it in properties. Once it builds the directory, I had to add it to the Gtlfloader manually by drag and drop the directory into it from VS.
My code:
using System.IO;'
using GltfGenerator;'
namespace Generator
{
class Program
{
static void Main(string[] args)
{
var generator = new CodeGenerator(@"..\..\..\..\glTF\specification\2.0\schema\glTF.schema.json");
generator.ParseSchemas();
generator.ExpandSchemaReferences();
generator.EvaluateInheritance();
generator.PostProcessSchema();
generator.CSharpCodeGen(Path.GetFullPath(@"..\..\..\glTFLoader\Schema"
));
}
}
}
Due to the changes to the library in this project, I am not sure it was needed but I think of importing content it is at some point it is, so I had to add in the following code from the glTF
library to make build the Schema directory ONLY.
You need this to call as string instead and return void instead of IDictionary<string, string>
.
public void CSharpCodeGen(string outputDirectory)
{
// make sure the output directory exists
System.IO.Directory.CreateDirectory(outputDirectory);
GeneratedClasses = new Dictionary<string, CodeTypeDeclaration>();
foreach (var schema in FileSchemas)
{
if (schema.Value.Type != null && schema.Value.Type[0].Name == "object")
{
CodeGenClass(schema.Key, outputDirectory);
}
}
}
private void CodeGenClass(string fileName, string outputDirectory)
{
var schemaFile = RawClass(fileName, out string className);
CSharpCodeProvider csharpcodeprovider = new CSharpCodeProvider();
var sourceFile = Path.Combine(outputDirectory, className + "." + csharpcodeprovider.FileExtension);
IndentedTextWriter tw1 = new IndentedTextWriter(new StreamWriter(sourceFile, false), " ");
csharpcodeprovider.GenerateCodeFromCompileUnit(schemaFile, tw1, new CodeGeneratorOptions());
tw1.Close();
}
There are a few issues with packages especially with await sync since it seems they have been removed from the packages. netcoreapp3.0 is no longer supported so there is that upgrade too. If you upgrade the packages you're in for some work since function names have changed and it will not build as expected.
I was kind of turned off on the fact it uses universal windows but I am bypassing universal windows straight up going to Framework 4.7.2. Of course it has issues has issues but there are workarounds. :)
Hope to see more of this project in the future! D12!