System.Data.SQLite
View Ticket
Not logged in
Ticket UUID: 1bd06f43a0e33fb8fc687e030a18e4bb1544273d
Title: LoadExtension
Status: Closed Type: Incident
Severity: Important Priority: Medium
Subsystem: Integration_Via_PInvoke Resolution: Need_More_Info
Last Modified: 2015-01-14 17:32:08
Version Found In: 1.0.94
User Comments:
anonymous added on 2014-12-27 01:01:51: (text/x-fossil-plain)
I tried
...
db.EnableExtensions(true);
db.LoadExtension("libsqlitefunctions.so", "sqlite3_extension_init");
...
-> error message: modul not found
It worked fine within "SQLite Expert Personel". I can load/unload it and use the math functions (e.g. select cos(45) no problem.
Then I tried to implement it in my little VisualStudio 2010 project.
That does not work. Why ? What is wrong ?
(sorry I'm a dotnet beginner, but I could not find anything helpful in the net).
Thanks for help
Simon

anonymous added on 2014-12-28 23:15:39: (text/x-fossil-plain)
I realized that you have already included LHMs lib.
So I wrote my own lib (libsimon.dll) with my own function but the error stays.

mistachkin added on 2014-12-29 17:32:08: (text/x-fossil-plain)
Is the DLL to be loaded located along the PATH or in the application directory?

anonymous added on 2014-12-30 02:30:08: (text/x-fossil-plain)
I took LHMs extension-functions.c file:
1.added my simple rownum(n) function
2.added this function to the scalar function registration array in the file
3.commented out all other scalar and aggregate functions from the both registration arrays in the file

then I compiled the file: gcc -g -shared extension-functios.c -o libsimon.dll

I copied that .dll file to a directory which is incluede in the PATH environment variable
AND I copied it to my project VS Studio project directory into bin directory.
Simon

mistachkin added on 2015-01-02 21:50:14: (text/x-fossil-plain)
Is this being done on Windows?  Are you able to load the DLL into the Dependency
Walker (see "http://www.dependencywalker.com/") tool and double check that no
errors are seen?

anonymous added on 2015-01-03 09:29:46: (text/x-fossil-plain)
I can't see any errors in dependencywalker.
I just see a lot of information which tells me nothing.

anonymous added on 2015-01-03 09:30:49: (text/x-fossil-plain)
Yes it is Windows 7, 64bit

mistachkin added on 2015-01-04 21:08:41: (text/x-fossil-plain)
Ok, I think that may explain the issue.  Make sure that the DLL you compiled is
64-bit if the application process is 64-bit.

The Dependency Walker tool can tell you if the DLL is 32-bit or 64-bit.  Task
Manager can tell you if the target application process is 32-bit or 64-bit.

mistachkin added on 2015-01-09 00:26:16: (text/x-fossil-plain)
Without further information, this ticket will be closed on Tuesday, January 13th,
2015.

mistachkin added on 2015-01-14 17:32:08: (text/x-fossil-plain)
Ticket closed due to lack of information.