Using POCO library for C++

Somebody uses POCO library(https://pocoproject.org/) under MACOS? Ive try to build my app in CLion using CMAKE but there is an error:

====================[ Clean | Debug ]===========================================
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/michaelikus/CLionProjects/training/poco01 --target clean -- -j 8

Clean finished

====================[ Build | all | Debug ]=====================================
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/michaelikus/CLionProjects/training/poco01 --target all -- -j 8
[ 50%] Building CXX object CMakeFiles/poco01.dir/poco01.cpp.o
[100%] Linking CXX executable poco01
ld: Undefined symbols:
  Poco::Data::SQLite::Connector::registerConnector(), referenced from:
      _main in poco01.cpp.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [poco01] Error 1
make[1]: *** [CMakeFiles/poco01.dir/all] Error 2
make: *** [all] Error 2

Answered by zOMGdev in 770059022

answer is - add to project all dependant libs

CMakeLists.txt is


cmake_minimum_required (VERSION 3.8)

find_package(Poco REQUIRED Data Foundation DataSQLite )

# Add source to this project's executable.
add_executable (poco01 "poco01.cpp" "poco01.h")

set(POCO_PREFIX      "/usr/local") # the directory containing "include" and "lib"
set(POCO_INCLUDE_DIR "${POCO_PREFIX}/include")
set(POCO_LIB_DIR     "${POCO_PREFIX}/lib")

target_include_directories(poco01 PRIVATE "${POCO_INCLUDE_DIR}")

target_link_libraries(poco01 Poco::Foundation Poco::Data Poco::DataSQLite)

code-block

GLHF, Mik

Accepted Answer

answer is - add to project all dependant libs

CMakeLists.txt is


cmake_minimum_required (VERSION 3.8)

find_package(Poco REQUIRED Data Foundation DataSQLite )

# Add source to this project's executable.
add_executable (poco01 "poco01.cpp" "poco01.h")

set(POCO_PREFIX      "/usr/local") # the directory containing "include" and "lib"
set(POCO_INCLUDE_DIR "${POCO_PREFIX}/include")
set(POCO_LIB_DIR     "${POCO_PREFIX}/lib")

target_include_directories(poco01 PRIVATE "${POCO_INCLUDE_DIR}")

target_link_libraries(poco01 Poco::Foundation Poco::Data Poco::DataSQLite)

code-block

GLHF, Mik

Using POCO library for C++
 
 
Q