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

Missing NativeTypeNameAttribute #231

Closed
talanc opened this issue Apr 28, 2021 · 2 comments · Fixed by #284
Closed

Missing NativeTypeNameAttribute #231

talanc opened this issue Apr 28, 2021 · 2 comments · Fixed by #284

Comments

@talanc
Copy link

talanc commented Apr 28, 2021

I'm getting a 'NativeTypeName could not be found' error after generating:

[DllImport("SketchUpAPI", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SUGetAPIVersion([NativeTypeName("size_t *")] nuint* major, [NativeTypeName("size_t *")] nuint* minor);

Should I just create a NativeTypeNameAttribute class?

@tannergooding
Copy link
Member

Yes, you can manually define an attribute such as: https://github.com/microsoft/ClangSharp/blob/main/sources/ClangSharp/Internals/NativeTypeNameAttribute.cs

Happy to take a PR that automatically creates this file as well 😄

@tannergooding
Copy link
Member

#284 adds support for this via --config generate-helper-types.

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