Содержание
- make fails with fatal error: sqlite3.h: No such file or directory compilation terminated. #86
- Comments
- Anaconda error: Cannot open include file: ‘sqlite3.h’: No such file or directory
- error
- 2 Answers 2
- Related
- Hot Network Questions
- Subscribe to RSS
- (Windows) fatal error: sqlite3.h: No such file or directory
- 2 Answers 2
- fatal error: sqlite3.h: No such file or directory
- 2 Answers 2
- Errors setting up CMake and vcpkg on windows `Can’t open include file`
- 1 Answer 1
make fails with fatal error: sqlite3.h: No such file or directory compilation terminated. #86
I cloned the mongrel2 and ran make command and finally ended in following error.
/codes/python/mongrel2$ make
cc -g -O2 -Wall -Wextra -Isrc -pthread -rdynamic -DNDEBUG -D_FILE_OFFSET_BITS=64 -fPIC -c -o src/config/config.o src/config/config.c
src/config/config.c:42:21: fatal error: sqlite3.h: No such file or directory
compilation terminated.
make: *** [src/config/config.o] Error 1
I looked into the src/config/config.c at line no 42 there is a header inclusion as follows #include , I grepped for sqlite3.h but I couldn’t find it.
Note: I have installed sqlite3 already in my system so I commented and tried installation found in many places sqlite3 is required.
The text was updated successfully, but these errors were encountered:
Is this on Linux? Maybe you are using a distribution that splits the «runtime» package from de «dev» package. If so you could search for something like «sqlite3-dev» package for your linux distribution.
Can you list all files belonging to a installed package on your distro? This way you will se if your installed sqlite3 package really includes the headers.
You need to install the development libraries for sqlite. Assuming a
debian or ubuntu setup you need to install the package libsqlite3-dev
edit: Urgh email reply missed your reply.
@daltonmatos @jsimmons : Thanks you both are right, I didn’t have sqlite3-dev package. It was under ubuntu, I fixed it by sudo apt-get install libsqlite3-dev , I think we should add this in documentation.
Источник
Anaconda error: Cannot open include file: ‘sqlite3.h’: No such file or directory
pip install peewee fails with Anaconda on Windows 10.
- OS: Windows 10
- Python: Python 3.6.4 :: Anaconda, Inc.
- Cython: 0.27.3
error
playhouse_sqlite_ext.c(531): fatal error C1083: Cannot open include file: ‘sqlite3.h’: No such file or directory error: command ‘D:\MyIDE\VS2015\VC\BIN\x86_amd64\cl.exe’ failed with exit status 2
But when I used official Python without Anaconda, it installed successfully.So what can I do for installing peewee successfully with Python in Anaconda?
2 Answers 2
I had same problem on Win7-X86 with VisualStudio 2017 Community and Anaconda 3 installed. Problem is that sqlite3.h not found during compiling with C/C++ compiler. File is available in Anaconda installation in LibraryInclude. During linking you will not find sqlite3.lib in Libraryinclude. You can add proper CL and LINK environment variables to solve problems.
Below presented pyx.bat to start python.exe with additional environment variables to fix problem. Don’t forget fix PYTHONPATH for your location either inside BAT or you need it in system level environment. Use it from command line as of:
pyx -m pip install -U peewee
I have this pyx.bat on the PATH, while no Python on the path
As of 3.1.x, you should be able to specify an environment variable to skip compilation of sqlite-extensions. See docs: http://docs.peewee-orm.com/en/latest/peewee/installation.html#skip-compilation-of-sqlite-extensions
Hot Network Questions
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.1.16.43160
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Источник
(Windows) fatal error: sqlite3.h: No such file or directory
I am trying to build a c++ application that uses sql.
For that I need sqlite3 header. I have already installed sql in my system and
sqlite3 in terminal gives:
SQLite version 3.36.0 2021-06-18 18:36:39 Enter «.help» for usage hints. Connected to a transient in-memory database. Use «.open FILENAME» to reopen on a persistent database. sqlite>
I have tried searching for this over web and found many relevant solutions including this.
Since I am working on Windows,
did not work. I also tried to change
with sqlite.h file in the same directory as my cpp code file(as I found people using it in videos). But this time I ended up with »’ C:UsersusernameAppDataLocalTempccwQfHZB.o:temp.cpp:(.text+0x1e): undefined reference to `sqlite3_open’ collect2.exe: error: ld returned 1 exit status »’
I am quite new to it, so any help is appreciated. Thanks.
2 Answers 2
So you clearly need a tutorial in how to use third party libraries. That’s too much to describe here. But this might get you started.
You have to tell your compiler where the header files you are including are located. Having them installed is not enough. Use the -I compiler option for that.
You have to tell your compiler where the library files that you are linking with are located. Having them installed is not enough. Use the -L compiler option for that.
You have to tell your compiler the names of the libraries that you are linking with. Having them installed is not enough. Use the -l compiler option for that.
All these options may need to be given multiple times depending on your precise setup and the libraries you are using.
Sorry but I don’t know what the sqlite libraries are called, and obviously I don’t know where you installed stuff.
Moving header files around is never the right solution, and any video you saw that does that doesn’t know what they are talking about. Install stuff where you think is best and then tell your compiler where that is. Any sqlite tutorial that uses the g++ compiler should go through this process in more detail, but there are a lot of bad C++ tutorials out there.
Источник
fatal error: sqlite3.h: No such file or directory
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:
The Makefile looks like this:
What am I doing wrong? Thanks for any help I can get.
2 Answers 2
I got this issue fixed with
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:
(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.
Note that this is a bad/confusing implementation. You should be putting the -I flag in the INCLUDES variable:
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:
will add the flags -Ilib/sqlite another/dir . note how the second directory doesn’t have a -I option.
Of course, by convention you should be using CPPFLAGS (for C preprocessor flags), not INCLUDES , but. 🙂
Источник
Errors setting up CMake and vcpkg on windows `Can’t open include file`
I’ve been trying to follow the vcpkg setup guide but I’ve been unable to solve the build error I get on the final step:
My vcpkg setup process is as follows:
- > git clone https://github.com/Microsoft/vcpkg.git
- > cd vcpkg
- > .bootstrap-vcpkg.bat
- > vcpkg install sqlite3:x64-windows
- > vcpkg integrate install
I confirm the sqlite install:
I create the following files in a test repo:
Start Build:
I then generate the build files by running the following in the build folder, and note that it is able to find SQLite3 :
Lastly, I trigger the build, which fails:
1 Answer 1
While you provide the SQLite3 library for linking with target_link_libraries() , you need to let your executable know where to find the header files. Use target_include_directories() :
CMake will populate these variables if SQLite3 is found (which it looks like it is):
- SQLite3_INCLUDE_DIRS : where to find sqlite3.h, etc.
- SQLite3_LIBRARIES : the libraries to link against to use SQLite3.
- SQLite3_VERSION : version of the SQLite3 library found
- SQLite3_FOUND : TRUE if found
So if your call to target_link_libraries() doesn’t work as expected, try using $ instead of sqlite3 .
Источник
You are not logged in. Please login or register.
Active topics Unanswered topics
QElectroTech → Code → Building QET from source — sqlite3 development package not found
Pages 1
You must login or register to post a reply
1 2021-06-29 13:07:46
- lucas
- Nouveau membre
- Offline
Topic: Building QET from source — sqlite3 development package not found
I am trying to build QElectroTech from source on Windows. I think I am almost there. However, I am stuck when running qmake, I get the following error
12:58:22: Starting: "C:Qt5.15.0mingw81_64binqmake.exe" C:UsersLucasDevelopment_qetqelectrotech-source-mirrorqelectrotech.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
Project ERROR: sqlite3 development package not found
12:58:22: The process "C:Qt5.15.0mingw81_64binqmake.exe" exited with code 3.
Error while building/deploying project qelectrotech (kit: Desktop Qt 5.15.0 MinGW 64-bit)
When executing step "qmake"
Any idea how to fix this? This might of course also be a problem with my Qt installation.
2 Reply by scorpio810 2021-06-29 17:18:16
- scorpio810
- QElectroTech Team Manager, Developer, Packager
- Offline
Re: Building QET from source — sqlite3 development package not found
Project ERROR: sqlite3 development package not found
Install sqlite3 development package, or in qelectrotech.pro
#comment the line below to disable the project database export
DEFINES += QET_EXPORT_PROJECT_DB
And comment :
unix|win32: PKGCONFIG += sqlite3
3 Reply by Joshua 2021-06-29 18:06:51
- Joshua
- QElectroTech Team Developer
- Offline
Re: Building QET from source — sqlite3 development package not found
We cross compil QElectroTech for windows on linux system, so we never build qelectrotech on windows.
The few time who I build Qet on windows, I comment the things related to sqlite3 (see the post of scorpio).
May be you can test this : https://gist.github.com/zeljic/d8b54278 … 169ee28c55
If they work for you, you can feedback to us how to ?
4 Reply by lucas 2021-06-30 12:27:57 (edited by lucas 2021-06-30 12:30:36)
- lucas
- Nouveau membre
- Offline
Re: Building QET from source — sqlite3 development package not found
Thank you for your help @Joshua and @scorpio810
I am able to compile qet now by commenting out the lines in the qmake file and it seems to work. I had to add the «sqlite3.h» header file to the Qt include directory. Otherwise I would get the following error
projectdatabase.cpp:33: error: sqlite3.h: No such file or directory
..qelectrotech-source-mirrorsourcesdataBaseprojectdatabase.cpp:33:10: fatal error: sqlite3.h: No such file or directory
#include <sqlite3.h>
But fortunately there weren’t any further compile or link errors after that.
I wasn’t so far able to compile it with sqlite3. It seems like qmake tries to look for the «libsqlite3-dev» package, which I cannot install for windows. But I am not that familiar with the Qt build process to figure out where to adapt this. @Joshua I was able to build the sqlite3.lib file with the instructions you linked. It’s just not so clear how to make the build process digest it. I will investigate this a little bit further and will let you know if i find a way to do it.
5 Reply by scorpio810 2021-06-30 12:45:40
- scorpio810
- QElectroTech Team Manager, Developer, Packager
- Offline
Re: Building QET from source — sqlite3 development package not found
Sqilte3 dependency is only for nomenclature database export to file function.
6 Reply by scorpio810 2021-06-30 12:58:38
- scorpio810
- QElectroTech Team Manager, Developer, Packager
- Offline
Re: Building QET from source — sqlite3 development package not found
7 Reply by lucas 2021-07-01 11:10:44 (edited by lucas 2021-07-01 11:17:48)
- lucas
- Nouveau membre
- Offline
Re: Building QET from source — sqlite3 development package not found
I get everything to compile now. It’s not in particular nice how I do it. I add the path of the sqlite3.h file and the sqlite3.dll manually in the qmake file and remove the dependency on the sqlite3 development package for windows. I don’t have to make any other changes to source files. It also works to statically link the sqlite3 library by just including the full flat sqlite3.c file into the project, but I liked this even less. If I find a better way, I’ll let you know.
unix: PKGCONFIG += sqlite3
win32: CONFIG += sql
win32:LIBS += "C:/<path>/sqlite3.dll"
win32:INCLUDEPATH += "C:/<path>" #path to sqlite3.h header file
8 Reply by scorpio810 2021-07-01 13:30:26
- scorpio810
- QElectroTech Team Manager, Developer, Packager
- Offline
Re: Building QET from source — sqlite3 development package not found
9 Reply by Joshua 2021-07-01 22:22:24
- Joshua
- QElectroTech Team Developer
- Offline
Re: Building QET from source — sqlite3 development package not found
May be we can just add the header and the dll of sqlite3 in a sub dir of QElectroTech and then write a relative path into qelectrotech.pro ?
Should the dll be created for each version of windows or the same dll work for every version of windows?
Posts: 9
Pages 1
You must login or register to post a reply
QElectroTech → Code → Building QET from source — sqlite3 development package not found
Generated in 1.984 seconds (21% PHP — 79% DB) with 9 queries
- Forum
- UNIX/Linux Programming
- Setting Up SQLite3 on Linux
Setting Up SQLite3 on Linux
Hello
I have read almost whole internet about setting up SQLite3 but without effect! I am really frustrated at this point and I would really appreciate some assistance with it. I am not going to describe all errors and problems I went through, instead I would like you to take my step by step through this process. I would REALLY appreciate this!!!!!!!!
In details, I would like to use SQLite3 database in my C++ project. I would like to set it up for Code::Blocks AND Sublime Text(although setting this up for Sublime Text is not necessary). I use Linux Mint. THANK YOU FOR YOUR HELP!!!
Have a nice day !!!
I would presume that you start by installing package
libsqlite3-dev
is it the same as just installing SQLite3? If so i have it already installed an i can use it from terminal?
if it is not the same how should i install it?
I do guess that the sqlite is first and foremost a library that is called and linked with other code, just like, say the iostream.
If you already have a compiled binary of a program, then you only need the library file(s). Dynamically linked, shared objects, …
My guess is that Mint has that in package named
libsqlite3
.
For compiling a program you do need the header file(s) of the library. You need to include the necessary headers in your source code and you need to tell the linker to use the library. Mint seems to put the header file in package named
libsqlite3-dev
. If a library has name libfoo.so, then one would add option -lfoo for g++ (that passes it to linker).
There is probably a dependency that installing
libsqlite3-dev
will install the library package too.
I don’t use Mint, but it probably has both CLI and GUI package management tools. If you don’t know how to use them, then you really should learn.
The Code::Blocks and Sublime are some GUI gizmos? Do they have a concept of «project» and a button to «build»? There is probably some «additional libraries to link into project» option too?
Do I need to include anything in source code using #include directive? If so, what exactly?
when i try to include it by #include <sqlite3.h> and pass -lsqlite3 to g++ compiler it still gives me an error that sqlite3.h no such a file or directory. when i compile it in codeblcks it says that it cannot find -lsqlite3. This is when i try to complite c program from https://www.tutorialspoint.com/sqlite/sqlite_c_cpp.htm. the first one titled «connecting to database».
Just to clarify, I tried: g++ test.cpp -lsqlite3
#include <sqlite3.h> no such a file or directory
it seems that you haven’t correctly installed the library.
¿what command did you use?
you should have
/usr/include/sqlite3.h
/usr/libsqlite3.so
(perhaps in /usr/local/)
Last edited on
Idea: Maybe compiler doesnt have path provided to sqlite3? Becuase I can use it perfectly fine from the terminal…
I have: libsqlite3.so in /opt/google/earth/free type: unknown
libsqlite3.so.0 in /usr/lib/i386-linux-gnu type: Link to unknown
libsqlite3.so.0.8.6 in /usr/lib/i386-linux-gnu type: unknown
I have sqlite3.h in home/filip/Downloads/sqlite-autoconf-3180000
the program and the library are two different things.
you haven’t installed the library correctly.
You were right libsqlite3-dev wasnt installed. Now I’ve installed it and used this command: g++ SQLite3.c -l sqlite3
no errors, but compiler didnt create executable file…
i have insntlled like following: sudo apt-get update
sudo apt-get install libsqlite3-dev
when i compile it with Code::Blocks it points out over 50 errors in sqlite3.c concerning pthread and dl kind of things…
SOLVED! THANK YOU VERY MUCH FOR PATIENCE AND USEFUL FEEDBACK!
Topic archived. No new replies allowed.





