For the sake of simplicity, I've actually compiled my native libs to have a .dll extension even under Linux. Then my loader code can be the same for all platforms. I would never name a Linux library .dll if it were to become a system/shared library (as in /usr/lib), but if it's bundled with my own code for private usage, I don't see a problem.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello I found wrong ".dll" under Unix:
string library = "path/to/custom/sqlite3.dll";
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
IntPtr libraryHandle = isWindows ?
WinLoader.LoadLibrary(library) :
UnixLoader.Open(library, 1);
Replace with:
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
IntPtr libraryHandle = isWindows ?
WinLoader.LoadLibrary("path/to/custom/sqlite3.dll") :
UnixLoader.Open("path/to/custom/sqlite3.so", 1);
Because you use only *.dll o_O
If you use dynamic then it is file type as so for Linux/FreeBSD and dll for Windows
Thanks!
For the sake of simplicity, I've actually compiled my native libs to have a
.dll
extension even under Linux. Then my loader code can be the same for all platforms. I would never name a Linux library.dll
if it were to become a system/shared library (as in/usr/lib
), but if it's bundled with my own code for private usage, I don't see a problem.