• <bdo id='oxNuG'></bdo><ul id='oxNuG'></ul>

      <tfoot id='oxNuG'></tfoot>
        <legend id='oxNuG'><style id='oxNuG'><dir id='oxNuG'><q id='oxNuG'></q></dir></style></legend>
        <i id='oxNuG'><tr id='oxNuG'><dt id='oxNuG'><q id='oxNuG'><span id='oxNuG'><b id='oxNuG'><form id='oxNuG'><ins id='oxNuG'></ins><ul id='oxNuG'></ul><sub id='oxNuG'></sub></form><legend id='oxNuG'></legend><bdo id='oxNuG'><pre id='oxNuG'><center id='oxNuG'></center></pre></bdo></b><th id='oxNuG'></th></span></q></dt></tr></i><div id='oxNuG'><tfoot id='oxNuG'></tfoot><dl id='oxNuG'><fieldset id='oxNuG'></fieldset></dl></div>
      1. <small id='oxNuG'></small><noframes id='oxNuG'>

      2. 致命错误:sqlite3.h:没有那个文件或目录

        时间:2023-08-19

          <i id='zWcDl'><tr id='zWcDl'><dt id='zWcDl'><q id='zWcDl'><span id='zWcDl'><b id='zWcDl'><form id='zWcDl'><ins id='zWcDl'></ins><ul id='zWcDl'></ul><sub id='zWcDl'></sub></form><legend id='zWcDl'></legend><bdo id='zWcDl'><pre id='zWcDl'><center id='zWcDl'></center></pre></bdo></b><th id='zWcDl'></th></span></q></dt></tr></i><div id='zWcDl'><tfoot id='zWcDl'></tfoot><dl id='zWcDl'><fieldset id='zWcDl'></fieldset></dl></div>

            <tfoot id='zWcDl'></tfoot>
            1. <legend id='zWcDl'><style id='zWcDl'><dir id='zWcDl'><q id='zWcDl'></q></dir></style></legend>

                  <tbody id='zWcDl'></tbody>

                <small id='zWcDl'></small><noframes id='zWcDl'>

                • <bdo id='zWcDl'></bdo><ul id='zWcDl'></ul>
                • 本文介绍了致命错误:sqlite3.h:没有那个文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试通过对 Zynq 板(ARM 架构)进行交叉编译来构建 C 应用程序.当我在没有提及 ARM arch 的情况下输入 make 时,它​​在我的笔记本电脑上运行良好.但是一旦我修改了 Makefile,我就会收到一条错误消息:

                  I'm trying to build a C application through cross compiling for a Zynq board (ARM architecture). When I type make without mentioning the ARM arch, it works fine on my laptop. But as soon as I modify the Makefile, I get an error saying:

                  main.c:20:43: fatal error: sqlite3.h: No such file or directory
                   #include "sqlite3.h" //library for sqlite3
                                                             ^
                  compilation terminated.
                  make: *** [ws_temp_server] Error 1
                  

                  Makefile 如下所示:

                  The Makefile looks like this:

                  SOURCE=lib/base64_enc.c lib/websocket.c lib/sha1.c lib/sqlite/sqlite3.c main.c 
                  CC = arm-xilinx-linux-gnueabi-gcc
                  LDFLAGS=-lpthread -ldl
                  INCLUDES=lib/
                  PROGRAM=ws_temp_server
                  
                  all: $(PROGRAM)
                  
                  $(PROGRAM): $(SOURCE)
                      $(CC) $(SOURCE) -I$(INCLUDES) -o$(PROGRAM) $(LDFLAGS)
                  clean:
                      rm $(PROGRAM)
                  

                  我做错了什么?感谢您提供的任何帮助.

                  What am I doing wrong? Thanks for any help I can get.

                  推荐答案

                  您没有提供足够的信息来确定:特别是,您没有说明 sqlite3.h 文件的位置实际上在你的文件系统上.但是,根据您所做的显示,我怀疑您需要将 INCLUDES 变量更改为:

                  You don't provide enough information to say for sure: in particular, you don't say where the sqlite3.h file actually is on your filesystem. However, based on what you do show I suspect you need to change the INCLUDES variable, to this:

                  INCLUDES = lib/sqlite
                  

                  (或者将代码中的 #include 更改为 #include "sqlite/sqlite3.h").这是假设头文件与 sqlite3.c 源文件在同一目录中.

                  (or else change the #include in your code to be #include "sqlite/sqlite3.h"). This is assuming that the header file is in the same directory as the sqlite3.c source file.

                  请注意,这是一个糟糕/令人困惑的实现.您应该将 -I 标志放在 INCLUDES 变量中:

                  Note that this is a bad/confusing implementation. You should be putting the -I flag in the INCLUDES variable:

                  INCLUDES = -Ilib/sqlite
                      ...
                  $(PROGRAM): $(SOURCE)
                          $(CC) $(SOURCE) $(INCLUDES) -o$(PROGRAM) $(LDFLAGS)
                  

                  INCLUDES 是复数,这可能会让某人相信他们可以在该变量中添加多个目录,但是如果您保持原样,这将导致奇怪的编译器错误:

                  INCLUDES is plural which may lead someone to believe they could add multiple directories in that variable, but if you leave it the way you have it, this will cause strange compiler errors:

                  INCLUDES = lib/sqlite another/dir
                      ...
                  $(PROGRAM): $(SOURCE)
                          $(CC) $(SOURCE) -I$(INCLUDES) -o$(PROGRAM) $(LDFLAGS)
                  

                  将添加标志 -Ilib/sqlite another/dir... 注意第二个目录如何没有 -I 选项.

                  will add the flags -Ilib/sqlite another/dir... note how the second directory doesn't have a -I option.

                  当然,按照惯例,您应该使用 CPPFLAGS(用于 C 预处理器标志),而不是 INCLUDES,而是... :)

                  Of course, by convention you should be using CPPFLAGS (for C preprocessor flags), not INCLUDES, but... :)

                  这篇关于致命错误:sqlite3.h:没有那个文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:适用于基于 ARM 的 Debian 设备的 Oracle Instant Clien 下一篇:如何为 WinRT/ARM 编译 sqlite?

                  相关文章

                  最新文章

                • <small id='Bnu4u'></small><noframes id='Bnu4u'>

                  • <bdo id='Bnu4u'></bdo><ul id='Bnu4u'></ul>

                      <legend id='Bnu4u'><style id='Bnu4u'><dir id='Bnu4u'><q id='Bnu4u'></q></dir></style></legend>

                      <i id='Bnu4u'><tr id='Bnu4u'><dt id='Bnu4u'><q id='Bnu4u'><span id='Bnu4u'><b id='Bnu4u'><form id='Bnu4u'><ins id='Bnu4u'></ins><ul id='Bnu4u'></ul><sub id='Bnu4u'></sub></form><legend id='Bnu4u'></legend><bdo id='Bnu4u'><pre id='Bnu4u'><center id='Bnu4u'></center></pre></bdo></b><th id='Bnu4u'></th></span></q></dt></tr></i><div id='Bnu4u'><tfoot id='Bnu4u'></tfoot><dl id='Bnu4u'><fieldset id='Bnu4u'></fieldset></dl></div>
                    1. <tfoot id='Bnu4u'></tfoot>