azadkuh / sqlite-amalgamation Goto Github PK
View Code? Open in Web Editor NEWThe SQLite amalgamation mirror with cmake
Home Page: http://www.sqlite.org/amalgamation.html
License: BSD 3-Clause "New" or "Revised" License
The SQLite amalgamation mirror with cmake
Home Page: http://www.sqlite.org/amalgamation.html
License: BSD 3-Clause "New" or "Revised" License
This is more a question than an issue.
Python3 can be embedded in a C/C++ code and so forth can execute python3 code which use sqlite3.
In case we have a C/C++ code using SQLite3-almagamation and at the same time we have python3 calling SQLite via the shared library is the code safe ?
In other words don't we have a risk of conflict between the 2 same code ?
Missing installation of executable files in cmake
I missed the recent updates here, so I wrote a script to update things automatically to a fork of this repository.
Result is on
https://github.com/rhuijben/sqlite-amalgamation
The script checks for new releases twice a day. All missing releases since 3.19.0 have been added as tags.
The version number in CMakeLists.txt isn't in sync with the actual version. Please update it.
[cmake] -- sqlite-amalgamation-3.38.2 configure success
[cmake] [1/5] Building C object CMakeFiles/shell_app.dir/shell.c.o
[cmake] [2/5] Building C object CMakeFiles/SQLite3.dir/sqlite3.c.o
[cmake] [3/5] Linking C static library libsqlite3.a
[cmake] [4/5] Linking C executable sqlite3
[cmake] FAILED: sqlite3
[cmake] : && /usr/bin/cc -O3 -DNDEBUG CMakeFiles/shell_app.dir/shell.c.o -o sqlite3 libsqlite3.a -lpthread -ldl && cd /home/ubuntu/Documents/sqlite-amalgamation-3.38.2/build && /usr/bin/strip sqlite3
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o): in function logFunc': [cmake] sqlite3.c:(.text+0x196ed): undefined reference to
log'
[cmake] /usr/bin/ld: sqlite3.c:(.text+0x1971d): undefined reference to log' [cmake] /usr/bin/ld: sqlite3.c:(.text+0x19781): undefined reference to
log'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1370): undefined reference to trunc' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1520): undefined reference to
exp'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1568): undefined reference to pow' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x15b0): undefined reference to
pow'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x15f8): undefined reference to fmod' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1640): undefined reference to
acos'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1688): undefined reference to asin' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x16d0): undefined reference to
atan'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1718): undefined reference to atan2' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1760): undefined reference to
cos'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x17a8): undefined reference to sin' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x17f0): undefined reference to
tan'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1838): undefined reference to cosh' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1880): undefined reference to
sinh'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x18c8): undefined reference to tanh' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1910): undefined reference to
acosh'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x1958): undefined reference to asinh' [cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x19a0): undefined reference to
atanh'
[cmake] /usr/bin/ld: libsqlite3.a(sqlite3.c.o):(.data.rel+0x19e8): undefined reference to `sqrt'
[cmake] collect2: error: ld returned 1 exit status
[cmake] ninja: build stopped: subcommand failed.
[cmake] -- Configuring incomplete, errors occurred!
need add -lm in target_link_libraries function.
if(UNIX)
target_link_libraries(shell_app PRIVATE -lm)
endif()
Hi Amir,
First of all thank you for your project, it's great to be able to use sqlite as a regular CMake project.
However, I had problems using it. I hope you are able to answer my few questions, as it could be useful for others.
I have built and installed the sqlite-amalgamation project.
To integrate the sqlite3 library to my project, I have used the way recommended in https://github.com/azadkuh/sqlite-amalgamation/blob/master/README.md:
find_package(Sqlite3)
target_link_libraries(myProjectName sqlite3::sqlite3)
Unfortunately, I have an error message when trying to build my project with cmake:
-- Could NOT find SQLite3 (missing: SQLite3_INCLUDE_DIR SQLite3_LIBRARY)
I am using CMake 3.15.4. I have seen that it contains a share\cmake-3.15\Modules\FindSQLite3.cmake
file.
Is your project intended to be found with it?
I supposed those two variables SQLite3_INCLUDE_DIR and SQLite3_LIBRARY are hints for CMake's find_package
to find the include dir and library file. If so, it should be mentionned in the README.md that the user needs to pass those to cmake.
Another question, why do I have to provide the sqlite library file path ? Wouldn't I have to provide the library directory instead?
Last question, once I have provided both, I have to do #include sqlite3.h
instead of #include sqlite3/sqlite3.h
. Is it normal?
Hi,
when using your cmake there is a problem with Debug version
Following command
cmake .. -G %Platform% -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=%LIB_DEST%
caused that this C_FLAGS are generated (flags.make file)
# CMAKE generated file: DO NOT EDIT!
# Generated by "NMake Makefiles" Generator, CMake Version 3.7
# compile C with C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
C_FLAGS = /DWIN32 /D_WINDOWS /W3 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 -MTd
C_DEFINES =
C_INCLUDES =
As you can see, there is /MDd together with -MTd. This is problem only with Debug, release is correctly configured to use only one flag.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.