Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.InvalidCastException: Can't cast type 'CppSharp.AST.Class' into 'CppSharp.AST.ClassTemplateSpecialization'. #82

Open
nathan130200 opened this issue Oct 11, 2018 · 5 comments

Comments

@nathan130200
Copy link

nathan130200 commented Oct 11, 2018

I cloned repository, and i executed command to create bindings like in docs:

"..\QtSharp.CLI.exe" "C:\Qt\5.11.1\mingw53_32\bin\qmake.exe" "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe"

But throw an exception:

Exceção Sem Tratamento: System.InvalidCastException: Não é possível converter um objeto do tipo 'CppSharp.AST.Class' no tipo 'CppSharp.AST.ClassTemplateSpecialization'.
   em CppSharp.DeclConverter.VisitClassTemplate(ClassTemplate decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.TypeConverter.VisitTemplateSpecialization(TemplateSpecializationType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.DeclConverter.VisitTypedef(TypedefDecl decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclContext(DeclarationContext ctx, DeclarationContext _ctx)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClass(Class class)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitTemplate(Template template, Template _template)
   em CppSharp.DeclConverter.VisitClassTemplate(ClassTemplate decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.TypeConverter.VisitTemplateSpecialization(TemplateSpecializationType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.DeclConverter.VisitTypedef(TypedefDecl decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclContext(DeclarationContext ctx, DeclarationContext _ctx)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClass(Class class)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitTemplate(Template template, Template _template)
   em CppSharp.DeclConverter.VisitClassTemplate(ClassTemplate decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.TypeConverter.VisitTemplateSpecialization(TemplateSpecializationType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.DeclConverter.VisitTypeAlias(TypeAlias decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitTemplate(Template template, Template _template)
   em CppSharp.DeclConverter.VisitTypeAliasTemplate(TypeAliasTemplate decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclContext(DeclarationContext ctx, DeclarationContext _ctx)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClass(Class class)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclaration(Declaration decl, Declaration _decl)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClass(Class class)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclaration(Declaration decl, Declaration _decl)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClass(Class class)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.TypeConverter.VisitTag(TagType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.TypeConverter.VisitPointer(PointerType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.TypeConverter.VisitTemplateParameterSubstitution(TemplateParameterSubstitutionType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.DeclConverter.VisitTypedef(TypedefDecl decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclContext(DeclarationContext ctx, DeclarationContext _ctx)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClassTemplateSpecialization(ClassTemplateSpecialization decl, ClassTemplateSpecialization _decl)
   em CppSharp.DeclConverter.VisitClassTemplateSpecialization(ClassTemplateSpecialization decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitClassTemplate(ClassTemplate decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.TypeConverter.VisitTemplateSpecialization(TemplateSpecializationType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.TypeConverter.VisitDependentName(DependentNameType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.DeclConverter.VisitTypedef(TypedefDecl decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclContext(DeclarationContext ctx, DeclarationContext _ctx)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClass(Class class)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitTemplate(Template template, Template _template)
   em CppSharp.DeclConverter.VisitClassTemplate(ClassTemplate decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.TypeConverter.VisitTemplateSpecialization(TemplateSpecializationType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.DeclConverter.VisitTypedef(TypedefDecl decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclContext(DeclarationContext ctx, DeclarationContext _ctx)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClass(Class class)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.TypeConverter.VisitTag(TagType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.DeclConverter.VisitField(Field decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClass(Class class)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclContext(DeclarationContext ctx, DeclarationContext _ctx)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClass(Class class)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitTemplate(Template template, Template _template)
   em CppSharp.DeclConverter.VisitClassTemplate(ClassTemplate decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.TypeConverter.VisitTemplateSpecialization(TemplateSpecializationType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.DeclConverter.VisitTypedef(TypedefDecl decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.TypeConverter.VisitTypedef(TypedefType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.DeclConverter.VisitTypedef(TypedefDecl decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclContext(DeclarationContext ctx, DeclarationContext _ctx)
   em CppSharp.DeclConverter.VisitClass(Class class, Class _class)
   em CppSharp.DeclConverter.VisitClass(Class class)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.TypeConverter.VisitTag(TagType type)
   em CppSharp.TypeVisitor`1.Visit(Type type)
   em CppSharp.TypeConverter.VisitQualified(QualifiedType qualType)
   em CppSharp.DeclConverter.VisitFunction(Function function, Function _function)
   em CppSharp.DeclConverter.VisitFunction(Function decl)
   em CppSharp.DeclVisitor`1.Visit(Declaration decl)
   em CppSharp.DeclConverter.Visit(Declaration decl)
   em CppSharp.DeclConverter.VisitDeclContext(DeclarationContext ctx, DeclarationContext _ctx)
   em CppSharp.ASTConverter.Convert()
   em CppSharp.ClangParser.ConvertASTContext(ASTContext context)
   em CppSharp.Driver.ParseCode()
   em CppSharp.ConsoleDriver.Run(ILibrary library)
   em QtSharp.CLI.Program.Main(String[] args) na C:\Users\Nathan Ferreira\Desktop\QtSharp\QtSharp.CLI\Program.cs:linha 196

This line:

            ConsoleDriver.Run(qtSharp);

Qt and QMake Version: 5.11.1
Mingw Version: mingw530_32
Platform: mingw32

@ddobrev
Copy link
Owner

ddobrev commented Oct 11, 2018

@nathan130200 I've been working on the generator, CppSharp, for the last few days, in order to wrap Qt 5.11.2. I might be able to finish by the end of this week. I'll let you know.

@nathan130200
Copy link
Author

Okay, thanks for the info. I thought it was already available for 5.11.

@ddobrev
Copy link
Owner

ddobrev commented Oct 11, 2018

Wrapping C++ is an enormous task and @tritao and myself are pretty much on our own. So almost every new Qt version reveals inadequacies in CppSharp which we need to fix.

@ezolotko
Copy link

@ddobrev thank you for your work! And what is the latest Qt version "supported" by QtSharp (i.e. the bindings can be generated for)?

@ddobrev
Copy link
Owner

ddobrev commented Oct 21, 2018

@ezolotko I've fixed 3 bugs but at least one more remains. I'll let you know when it's out of the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants