oatpp / example-crud

A complete example of a "CRUD" service (UserService) built with Oat++.
https://oatpp.io/
Apache License 2.0
100 stars 63 forks source link

Configure fails, all dependencies installed. #5

Closed acidtonic closed 3 years ago

acidtonic commented 3 years ago

Gentoo Linux, gcc 9.3.0, cmake 3.16.5

installed oat++ installed oat-swagger installed oat-sqlite

Cloned this repo

$ mkdir build
$ cd build
$ cmake ..
-- Configuring done
CMake Error at CMakeLists.txt:56 (add_executable):
  Target "crud-exe" links to target "SQLite::SQLite3" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at CMakeLists.txt:6 (add_library):
  Target "crud-lib" links to target "SQLite::SQLite3" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at CMakeLists.txt:59 (add_executable):
  Target "crud-test" links to target "SQLite::SQLite3" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
bamkrs commented 3 years ago

Target "crud-exe" links to target "SQLite::SQLite3" but the target was not

It seems like you are missing the SQLite3 Library.

acidtonic commented 3 years ago

I have sqlite3 installed, I use it in many of my C projects. Do I need a C++ Sqlite3 library? I see no dependency listed for that.

acidtonic commented 3 years ago
/usr/include/sqlite3.h

$ pkg-config --libs sqlite3
-lsqlite3

What else is needed?

acidtonic commented 3 years ago

Looks like the -DOATPP_SQLITE_AMALGAMATION=ON flag did not get applied as I typed it manually and had a typo.

Looks like that changes the flag from sqlite3 to Sqlite::Sqlite3 and that is what broke it, my apologies.

lganzzzo commented 3 years ago

Hey @acidtonic ,

Just to summarize:

aohanhongzhi commented 10 months ago
-- Configuring done
CMake Error at CMakeLists.txt:6 (add_library):
  Target "crud-lib" links to target "SQLite::SQLite3" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at CMakeLists.txt:70 (add_executable):
  Target "crud-exe" links to target "SQLite::SQLite3" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at CMakeLists.txt:73 (add_executable):
  Target "crud-test" links to target "SQLite::SQLite3" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

how to solve ?

tomsn1978 commented 9 months ago

############################################################################

Flag '-DOATPP_SQLITE_AMALGAMATION=ON' used by oatpp-sqlite module only

############################################################################ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOATPP_BUILD_TESTS=OFF -DOATPP_SQLITE_AMALGAMATION=ON .. make install -j $NPROC

cd ../../

-- Configuring done
CMake Error at CMakeLists.txt:6 (add_library):
  Target "crud-lib" links to target "SQLite::SQLite3" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at CMakeLists.txt:70 (add_executable):
  Target "crud-exe" links to target "SQLite::SQLite3" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at CMakeLists.txt:73 (add_executable):
  Target "crud-test" links to target "SQLite::SQLite3" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

how to solve ?

############################################################################

Flag '-DOATPP_SQLITE_AMALGAMATION=ON' used by oatpp-sqlite module only

############################################################################ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOATPP_BUILD_TESTS=OFF -DOATPP_SQLITE_AMALGAMATION=ON .. make install -j $NPROC

cd ../../