Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 将SQLCipher与MonoTouch结合使用_Ios_Sqlite_Xamarin.ios_Sqlcipher_Entrypointnotfoundexcept - Fatal编程技术网

Ios 将SQLCipher与MonoTouch结合使用

Ios 将SQLCipher与MonoTouch结合使用,ios,sqlite,xamarin.ios,sqlcipher,entrypointnotfoundexcept,Ios,Sqlite,Xamarin.ios,Sqlcipher,Entrypointnotfoundexcept,我编译了一个静态库,并链接了SQLCipher和OpenSSL。完整项目、makefile和编译库可在此处找到: https://github.com/anujb/SQLCipherNet 当我在一个普通的Objective-CxCode项目中链接生成的库时,调用sqlite3\u键工作正常 我使用以下方法将同一个库链接到MonoTouch项目中: -gcc_flags "-L${ProjectDir} -lsqlciphernet -force_load ${ProjectDir}/libs

我编译了一个静态库,并链接了SQLCipher和OpenSSL。完整项目、makefile和编译库可在此处找到:

https://github.com/anujb/SQLCipherNet
当我在一个普通的Objective-CxCode项目中链接生成的库时,调用
sqlite3\u键
工作正常

我使用以下方法将同一个库链接到MonoTouch项目中:

-gcc_flags "-L${ProjectDir} -lsqlciphernet -force_load ${ProjectDir}/libsqlciphernet.a"
然后,我修改了SQLite NET,在每个
SQLite3.Open(…)
函数之后调用键函数:

[DllImport("__Internal", EntryPoint = "sqlite3_key")]
public static extern Result Key(IntPtr db, string key, int keyLength);
但是当调用Key方法时,我得到一个EntryPointNotFoundException。以下是堆栈跟踪:

System.EntryPointNotFoundException has been thrown at:
at (wrapper managed-to-native) SQLite.SQLite3:Decrypt (intptr,string,int)
at SQLite.SQLiteConnection..ctor (System.String databasePath) [0x00031] in 
../SQLite.cs:108 

显然stacktrace没有特别的帮助,但是我不知道从哪里开始调试这个问题。Halp?

我在为“调试| iPhoneSimulator”构建解决方案时遇到了相同的错误。但是,对于此配置,您的项目选项不包括您提到的
gcc_标志,因此异常是完全正常的

由于路径问题,尝试构建“Debug | iPhone”配置(其中指定了选项)失败。。。但我很确定,如果我修好它们,它会起作用;-)

更新

将库移动到正确的位置会让我:

Undefined symbols for architecture armv6:   "___udivmodsi4",
referenced from:
      _sqlite3BitvecSet in libsqlciphernet.a(sqlite3.o)
      _sqlite3BitvecClear in libsqlciphernet.a(sqlite3.o)
      _sqlite3BitvecTest in libsqlciphernet.a(sqlite3.o) ld: symbol(s) not found for architecture armv6

我相信它是因为libopenssl而丢失的?

哈哈,业余的错误!当我调整构建参数时效果很好。现在我只需要记录这个过程!