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

JNAerator fails to output anything after hours of processing a simple header #122

Open
MayaPosch opened this issue May 22, 2020 · 0 comments

Comments

@MayaPosch
Copy link

I tried to use JNAerator to create a JNA binding for a simple library that has the following header: https://github.com/MayaPosch/NymphCast/blob/master/src/client_lib/nymphcast_client.h

Under MSYS2 Bash, I ran the following command:

java -jar /e/Projects/testing/JNAerator/jnaerator/target/jnaerator-0.13-SNAPSHOT-shaded.jar -library nymphcast_jna nymphcast_client.h -o . -v -mode StandaloneJar

Output:

5 21, 2020 6:17:56 ▒ߌ▒ com.ochafik.admin.visualstudio.VisualStudioUtils getProp
INFO: [environment] ProgramFiles(x86)=C:\Program Files (x86)
5 21, 2020 6:17:56 ▒ߌ▒ com.ochafik.admin.visualstudio.VisualStudioUtils getProp
INFO: [environment] VISUAL_STUDIO_HOME=C:\Program Files (x86)\Microsoft Visual Studio 14.0
5 21, 2020 6:17:56 ▒ߌ▒ com.ochafik.admin.visualstudio.VisualStudioUtils getProp
INFO: [environment] ProgramFiles(x86)=C:\Program Files (x86)
5 21, 2020 6:17:56 ▒ߌ▒ com.ochafik.admin.visualstudio.VisualStudioUtils getProp
INFO: [environment] WINDOWS_SDK_HOME=C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A
5 21, 2020 6:17:56 ▒ߌ▒ com.ochafik.admin.visualstudio.VisualStudioUtils getProp
INFO: [environment] VISUAL_STUDIO_INCLUDES=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include
Auto-configuring parser...
5 21, 2020 6:17:56 ▒ߌ▒ com.ochafik.lang.jnaerator.JNAeratorConfigUtils getProp
INFO: [environment] JNAERATOR_INCLUDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include;.
5 21, 2020 6:17:56 ▒ߌ▒ com.ochafik.lang.jnaerator.JNAeratorConfigUtils getProp
INFO: [environment] JNAERATOR_FRAMEWORKS_PATH=/System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks;/System/Library/Frameworks/ApplicationServices.framework/Versions/Current/Frameworks;/System/Library/Frameworks;/Library/Frameworks;/Local/Library/Frameworks/;C:\Users\Maya/Library/Frameworks
os.arch = amd64
5 21, 2020 6:17:56 ▒ߌ▒ com.ochafik.lang.jnaerator.JNAerator jnaerate
INFO: Include path :
        C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
        C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include
        .
Parsing native headers...
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\crtdefs.h:1:0: error: File not found: corecrt.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath:1:0: error: File not found: math.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cstdlib:1:0: error: File not found: stdlib.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cstdio:1:0: error: File not found: stdio.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cstring:1:0: error: File not found: string.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cstddef:1:0: error: File not found: stddef.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception:8:0: error: File not found: malloc.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\eh.h:1:0: error: File not found: corecrt_terminate.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cfloat:1:0: error: File not found: float.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cwchar:1:0: error: File not found: wchar.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iosfwd:1:0: error: File not found: crtdbg.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocinfo.h:1:0: error: File not found: ctype.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocinfo.h:1:0: error: File not found: locale.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cerrno:1:0: error: File not found: errno.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:1:0: error: File not found: share.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
E:\Projects\NymphCast\src\client_lib\nymphcast_client.h:20:0: error: File not found: nymph/nymph.h in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include .
Writing preprocessor output to '_jnaerator.preprocessed.c'
Writing preprocessor macros to '_jnaerator.macros.cpp'
Now parsing 201 slices

fullParsing error.txt contents:

line 43:23 Failed to match any alternative with token [@324,853:858='_Fgetc',<14>,43:23]
	 File: C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include\\fstream:42
	Input:   inline   bool   _Fgetc ( wchar_t &   _Wchar
	 Rule: 567:7: ({...}? => pragmaContent | functionDeclaration |{...}? => externDeclarations |{...}? => IDENTIFIER qualifiedIdentifier SEMICOLON | varDecl SEMICOLON | objCClassDef | typeDef | forwardClassDecl | namespaceDecl )
	Stack: []

line 43:37 Failed to match any alternative with token [@327,867:867='&',<36>,43:37]
	 File: C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include\\fstream:42
	Input: bool   _Fgetc ( wchar_t &   _Wchar ,   FILE
	 Rule: 567:7: ({...}? => pragmaContent | functionDeclaration |{...}? => externDeclarations |{...}? => IDENTIFIER qualifiedIdentifier SEMICOLON | varDecl SEMICOLON | objCClassDef | typeDef | forwardClassDecl | namespaceDecl )
	Stack: []

line 43:39 Failed to match any alternative with token [@329,869:874='_Wchar',<14>,43:39]
	 File: C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include\\fstream:42
	Input: _Fgetc ( wchar_t &   _Wchar ,   FILE   *
	 Rule: 567:7: ({...}? => pragmaContent | functionDeclaration |{...}? => externDeclarations |{...}? => IDENTIFIER qualifiedIdentifier SEMICOLON | varDecl SEMICOLON | objCClassDef | typeDef | forwardClassDecl | namespaceDecl )
	Stack: []

line 43:47 Failed to match any alternative with token [@332,877:880='FILE',<14>,43:47]
	 File: C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include\\fstream:42
	Input: &   _Wchar ,   FILE   * _File ) 
	 Rule: 567:7: ({...}? => pragmaContent | functionDeclaration |{...}? => externDeclarations |{...}? => IDENTIFIER qualifiedIdentifier SEMICOLON | varDecl SEMICOLON | objCClassDef | typeDef | forwardClassDecl | namespaceDecl )
	Stack: []

line 43:53 Failed to match any alternative with token [@335,883:887='_File',<14>,43:53]
	 File: C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include\\fstream:42
	Input: ,   FILE   * _File ) 
   	 {
	 Rule: 567:7: ({...}? => pragmaContent | functionDeclaration |{...}? => externDeclarations |{...}? => IDENTIFIER qualifiedIdentifier SEMICOLON | varDecl SEMICOLON | objCClassDef | typeDef | forwardClassDecl | namespaceDecl )
	Stack: []

line 46:1 mismatched input [@351,953:954='if',<91>,46:1] expecting RBRACE
line 46:12 mismatched input [@357,964:964='=',<57>,46:12] expecting RPAREN
line 46:14 Failed to match any alternative with token [@359,966:967='::',<52>,46:14]
	 File: C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include\\fstream:45
	Input: ( _Meta   =   ::   fgetwc
	 Rule: 
	Stack: []

Despite pegging the CPU at 100% across all its cores for hours on end (I let the job run overnight), no output is produced.

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

1 participant