-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
New Version is not aot compatible and can't use static library #14
Comments
Do you get an exception or a trim warning? Because the static analyzers for aot don't report anything. And i think i tested it with my UI Framework a while ago |
dotnet/runtime#104229 |
Closing this issue, tested it before uploading, if any other issue regarding aot persists just reopen the issue. |
The first issue is fixed, but I still can’t depend on the static library. <DirectPInvoke Include="cimgui" />
<NativeLibrary Include="cimgui.lib" /> Reference: |
Thanks for the information. However, it seems like there might be a misunderstanding. I don’t provide the static libraries for cimgui. For now, I will only use the shared libraries. If the static library dependency is a real concern for you, feel free to make a fork of the project and submit a pull request with the necessary changes. I'm open to reviewing it if that approach fits your needs. (Please do not add or modify any binaries including shared and static libs, you can modify the github actions files for that. And don't use LibraryImport, it's too slow) |
I add static library manually in my project and it automatically depend on it. |
or create two seperated package the first, VTable with Dynamic Library and the second DLLImport with Static Library. |
I currently don't have the motivation for doing it on my own, as i said if you want you can do a fork and make a pull request, the generator supports different modes for generating bindings (see https://github.com/HexaEngine/HexaGen/blob/7a1a3c664b55c7e98b2000c9f7df6caf4e9ecd4f/HexaGen/CsCodeGeneratorConfig.cs#L24) you just have to change that in the generator,json files located here https://github.com/HexaEngine/Hexa.NET.ImGui/blob/master/Generator/cimgui/generator.json (note each lib has it's own config file 4 in total). DllImport and LibraryImport (which just generates a DllImport) is slow compared to the VTable method (I probably should use a different name, a api function table would be more accurate) when using normal C#. |
Hi, In all mine bindings I've used LibraryImport and I'm not sure what slowness your meaning? |
@amerkoleci |
Additionally DllImport has a limitation in netstandard and can't be used for multiple platforms. Since on linux shared libs usually start with libXXX.so and on windows we have XXX.dll which often creates name differences and this becomes a problem when we try to load system libs, and setting NativeLibrary.SetDllImportResolver only works on .NET Core 3.0 or greater excluding netstandard versions and this would break .NET Framework compatibility. For this reason i close this issue as not planned. |
In version 1.1.0, I can use the static library and NativeAOT. However, in version 2.0.0 and later, it uses reflections, making it incompatible with AOT, and I can’t depend on the static library too.
The text was updated successfully, but these errors were encountered: