我的代码:
//this is actually a hardcoded path but I shorted it for readability purposes
string loc = "libsqlitefunctions.so";
sqlLiteConnection.EnableExtensions(true);
sqlLiteConnection.LoadExtension(loc);
我得到的错误是无法找到"指定的模块。"但是,运行这个:
SQLiteCommand cmd = new SQLiteCommand(sqlLiteConnection);
cmd.CommandText = @"select load_extension('" + loc + "');";
cmd.ExecuteNonQuery();
我得到了同样的错误,但是当通过SQLiteStudio运行时,命令有效:
//Same path as above, cut down for readability purposes
select load_extension('libsqlitefunctions.so');
select cos(radians(45));
这样可以正常工作,并返回我尝试加载的扩展程序附带的cos函数的结果。我能做错什么?我开始感到迷茫。