How can I resolve: cannot find -lsqlite3?

  c++, cmake, gcc, sqlite, visual-studio

I am compiling a Linux-based CMake C++ project under Windows 10 using GCC/G++ and VS2019 IDE.

I have installed sqlite3.dll, sqlite3.lib, and lsqlite3.so via the PATH environment variable.

enter image description here

Yet, I am getting the following error:

 [297/795] cmd.exe /C "cd . && C:PROGRA~1mingw-w64x86_64-8.1.0-posix-seh-rt_v6-rev0mingw64bing++.exe -g -DDEBUG -pthread -O1 -std=c++11 -Wall    -g -DDEBUG -pthread -O1 -std=c++11 -Wall -lsqlite3 src/CMakeFiles/hist.dir/apps/MyLinuxBasedCppProject/hist.cc.obj -o ......binhist.exe -Wl,--out-implib,..binlibhist.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../bin/libMyLinuxBasedCppProject.a  -Wl,-Bstatic  -lz  -Wl,-Bdynamic  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
  FAILED: ../../../bin/hist.exe 
  cmd.exe /C "cd . && C:PROGRA~1mingw-w64x86_64-8.1.0-posix-seh-rt_v6-rev0mingw64bing++.exe -g -DDEBUG -pthread -O1 -std=c++11 -Wall    -g -DDEBUG -pthread -O1 -std=c++11 -Wall -lsqlite3 src/CMakeFiles/hist.dir/apps/MyLinuxBasedCppProject/hist.cc.obj -o ......binhist.exe -Wl,--out-implib,..binlibhist.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../bin/libMyLinuxBasedCppProject.a  -Wl,-Bstatic  -lz  -Wl,-Bdynamic  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
  C:/PROGRA~1/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsqlite3
C:UserspcsourcereposMyLinuxBasedCppProjectoutbuildMingw64-Debugcollect2.exe : error : ld returned 1 exit status


  [298/795] cmd.exe /C "cd . && C:PROGRA~1mingw-w64x86_64-8.1.0-posix-seh-rt_v6-rev0mingw64bing++.exe -g -DDEBUG -pthread -O1 -std=c++11 -Wall    -g -DDEBUG -pthread -O1 -std=c++11 -Wall -lsqlite3 src/CMakeFiles/seqc.dir/apps/MyLinuxBasedCppProject/seqc.cc.obj -o ......binseqc.exe -Wl,--out-implib,..binlibseqc.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../bin/libMyLinuxBasedCppProject.a  -Wl,-Bstatic  -lz  -Wl,-Bdynamic  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
  FAILED: ../../../bin/seqc.exe 
  cmd.exe /C "cd . && C:PROGRA~1mingw-w64x86_64-8.1.0-posix-seh-rt_v6-rev0mingw64bing++.exe -g -DDEBUG -pthread -O1 -std=c++11 -Wall    -g -DDEBUG -pthread -O1 -std=c++11 -Wall -lsqlite3 src/CMakeFiles/seqc.dir/apps/MyLinuxBasedCppProject/seqc.cc.obj -o ......binseqc.exe -Wl,--out-implib,..binlibseqc.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../bin/libMyLinuxBasedCppProject.a  -Wl,-Bstatic  -lz  -Wl,-Bdynamic  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
  C:/PROGRA~1/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsqlite3
C:UserspcsourcereposMyLinuxBasedCppProjectoutbuildMingw64-Debugcollect2.exe : error : ld returned 1 exit status

How can I resolve this?

Source: Windows Questions C++

LEAVE A COMMENT