CppSharp
CppSharp copied to clipboard
Multiple "ConsoleDriver.Run"s causes AccessViolationException
Brief Description
Adding two ConsoleDriver.Run()
statements in the main function causes AccessViolationException
. Keeping either one of them clears the exception.
OS: Windows 10.
Used settings
options.CheckSymbols = true;
Stack trace or incompilable generated code
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
--------------------------------
at CppSharp.Parser.ClangParser+__Internal.Build(IntPtr, IntPtr, IntPtr, Boolean)
--------------------------------
at CppSharp.Parser.ClangParser.Build(CppSharp.Parser.CppParserOptions, CppSharp.Parser.CppLinkerOptions, System.String, Boolean)
at CppSharp.Passes.GenerateSymbolsPass.GenerateSymbols()
at CppSharp.Passes.GenerateSymbolsPass.VisitASTContext(CppSharp.AST.ASTContext)
at CppSharp.Generators.BindingContext.<RunPasses>b__37_0(CppSharp.Passes.TranslationUnitPass)
at CppSharp.PassBuilder`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].RunPasses(System.Action`1<System.__Canon>)
at CppSharp.Generators.BindingContext.RunPasses()
at CppSharp.Driver.ProcessCode()
at CppSharp.ConsoleDriver.Run(CppSharp.ILibrary)
at Program.<Main>$(System.String[])
Addressed by adding two modules instead of running two libraries.
Using two modules works but it also means they have to share the same options.
Is there any way to process two libraries in one application?