-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Windows library doesn't work if VCRUNTIME.DLL is missing on host device #33
Comments
In the meantime it would be nice to have a hint in the readme, so that users of the plugin do not run into "No valid library handle" while trying it out ;) |
Yes, Please. I could have never figured it out by myself without the help of @progsource |
A section has been added to the |
a third option would be to cross-compile for windows using a linux host device. This might be the solution in this case. |
I've added a cross-compilation build for Windows to Github Actions which can be downloaded here. Why is this build not included in Godot SQLite by default?Currently the binary is excessively large... (~7 MB) There's probably an additional compilation/linker flag that I'm missing to reduce the file size to something more respectable (probably around 4-5 MB). Once I figure out the offending flag, this cross-compilation build becomes the default and closes this issue as a result. |
I'm closing this issue as the default Windows binary included with this plugin is now the MinGW cross-compiled version by default. |
Basically if the host device doesn't have any VC++ redistributables installed, the DLL library will fail to load on Windows devices.
This is due to the fact that the DLL has a dependency on VCRUNTIME.DLL libraries that has to be satisfied.
Two possible options are available to solve this issue:
1. Change the MSVC compilation flag from /MD to /MT
This would results in a DLL that includes the runtime dependencies and thus does not dependent on any VC++ redistributables being installed on the host.
https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-160
This would require the
godot-cpp
-repository to update their SConstruct to give the option to select this compilation flag since both the bindings and the library have to be compiled using the same flag. Or I could simply rewrite the SConstruct to handle compilation of both bindings and godot-sqlite in the same file.2. Compile the library with MinGW instead of MSVC.
Compilation using the MinGW compiler is possible, but currently results in huge library sizes (~14 MB). Most likely due to the fact that the SConstruct doesn't properly set the correct compilation flags for the release target. This might be fixable by only modifying the SConstruct of this library, but I don't know enough about MinGW to make a correct judgement on this one.
Both options are feasible, but I'll have to do some more experimentation and research to resolve this issue in the best way possible...
The text was updated successfully, but these errors were encountered: