A
A
AleksandrFl2020-10-03 15:55:08
C++ / C#
AleksandrFl, 2020-10-03 15:55:08

How to build a visual studio CMake project using SQLite?

How to build a project for visual studio CMake Using SQLite3?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AleksandrFl, 2020-10-03
@AleksandrFl

https://www.sqlite.org/download.html#amalgtarball
download from here sqlite-autoconf-3330000.tar.gz
run
x64 Native Tools Command Prompt for VS 2019

cd C:/sql
C:\sql>nmake /f Makefile.msc

similar to build tiff
nmake /f Makefile.vc
but it doesn't work for visual studio
https://progi.pro/kak-skompilirovat-curl-s-openssl...
build curl
open the downloaded project in Visual Studio (file - open CMake)
5f78776f30803609642466.jpeg
in the CMake settings set the path before ninja and files: EXE_SQLITE3, SQLITE_LIBRARY (.lib), SQLite3 include dir
save json
It doesn't work
How to include SQLite3 in CMake project?
I try this:
installed CMake, downloaded the project from github.com
for the project you need sqlite3
download 1 archive https://sqlite.org/sqlite-shell-win32-x86-3071300.zip
and the second archive for x64 https://www.sqlite .org/2020/sqlite-dll-win64-x64-3...
unzip all this into the C: / sql2 folder,
now go to the visual studio terminal
and run the command:
lib /MACHINE:X64 /DEF:"C:\sql2\sqlite3.def" /OUT:"C:\sql2\sqlite3.lib"

5f7b33b7844d3600439683.jpeg
a .lib file should appear
download 3 archive: https://www.sqlite.org/2020/sqlite-amalgamation-33...
and unpack the contents in C:/sql2
now you need to start / parameters
in the search for "environment variables"
5f7b373db8dcc025926597.jpeg
5f7b380e21e1a854761990.jpeg
add as in the picture and check in cmd
5f7b38a1a34a3215130708.jpeg
now run Git Bash
5f7b357ec3b79353331302.jpeg
go to the directory of the downloaded project, create the build folder there and go to it and
run the command:
cmake -DSQLITE3_INCLUDE_DIR=C:/sql2 -DSQLITE3_LIBRARY=C:/sql2/sqlite3.lib -DEXE_SQLITE3=C:/sql2/sqlite3.exe ..

for tiff and curl:
cmake -DSQLITE3_INCLUDE_DIR=C:/sql2 -DSQLITE3_LIBRARY=C:/sql2/sqlite3.lib -DEXE_SQLITE3=C:/sql2/sqlite3.exe -DCURL_INCLUDE_DIR=C:/curl/include -DCURL_LIBRARY=C:/curl/include/curl/libcurl-x64.dll -DTIFF_INCLUDE_DIR=C:/tiff2/libtiff -DTIFF_LIBRARY_RELEASE=C:/tiff2/libtiff/libtiff.lib ..

for curl, you need to drop everything from the folders into the include / curl folder and drop two files libcrypto, libssl version 1.4 into the include folder.
c in this post you can find how to install openssl https://stackoverrun.com/en/q/12876670
compile curl https://github.com/curl/curl
here all paths related to sqlite go to sql2 folder
SQLITE3_INCLUDE_DIR - .h files , .c
SQLITE3_LIBRARY - .lib file
EXE_SQLITE3 - the downloaded exe
will be built into the build folder and you can run the project in visual studio
Here are the compiled library files, but it's better to compile the
compiled files yourself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question