菜鸟教程小白 发表于 2022-12-12 20:37:33

ios - "_sqlite3_key"未找到架构 i386 的符号


                                            <p><p>您好,我使用这个 SQLCipher(<a href="http://sqlcipher.net/ios-tutorial/" rel="noreferrer noopener nofollow">http://sqlcipher.net/ios-tutorial/</a>) 来加密我的 sqlite,但是当我编译时遇到了这个错误</p>

<pre><code> &#34;_sqlite3_key&#34;, referenced from:

- in LCAppDelegate.o

Symbol(s) not found for architecture i386
</code></pre>

<p>当我在 AppDelegate 中使用此代码时发生这种情况</p>

<pre><code>#import &lt;sqlite3.h&gt;

    ...
    NSString *databasePath = [
                              stringByAppendingPathComponent: @&#34;sqlcipher.db&#34;];
    sqlite3 *db;
    if (sqlite3_open(, &amp;db) == SQLITE_OK) {
      const char* key = [@&#34;BIGSecret&#34; UTF8String];
      sqlite3_key(db, key, strlen(key));
      if (sqlite3_exec(db, (const char*) &#34;SELECT count(*) FROM sqlite_master;&#34;, NULL, NULL, NULL) == SQLITE_OK) {
            // password is correct, or, database has been initialized

      } else {
            // incorrect password!
      }

      sqlite3_close(db);
    }
</code></pre>

<p>有人知道如何解决这个问题吗?请帮帮我!!!</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>你没有为 i386 编译它——看教程</p>

<p>将 i386 添加到有效的拱门和要构建的拱门中。</p>

<h2> <img src="/image/lWQ64.png" alt="enter image description here"/> </h2>

<p>=> 只有 SIMULATOR 是 i386</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - &#34;_sqlite3_key&#34;未找到架构 i386 的符号,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/22512614/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/22512614/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - &#34;_sqlite3_key&#34;未找到架构 i386 的符号