1

libzippp github link

vcpkg github link

It is supposed to be straightforward, according to the documentation one should "just" ./vcpkg install libzippp

But i've tried it plus a little bit of everything but nothing works.

I'm using VS Code, my CMakeLists.txt is:

cmake_minimum_required(VERSION 2.8)
project(startProject)
set(Leptonica_DIR /Users/alejandrocamba/Documents/leptonica/build)
find_package(OpenCV REQUIRED)
find_package(Leptonica REQUIRED)
find_package(Tesseract REQUIRED)
find_package(libzippp CONFIG REQUIRED)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${Leptonica_INCLUDE_DIRS})
include_directories(${Tesseract_INCLUDE_DIRS})

add_executable(startProject main.cpp)
target_link_libraries(startProject ${LIBRARIES})
target_link_libraries(startProject ${OpenCV_LIBS})
target_link_libraries(startProject ${Tesseract_LIBRARIES})
target_link_libraries(startProject PRIVATE libzip::libzip libzippp::libzippp)

I have startProject PRIVATE libzip::libzip libzippp::libzippp because vcpkg indicates that those are the targets for libzippp library.

On my c_cpp_properties.json i followed the documentation and included "${vcpkgRoot}/x64-osx/include"

        "includePath": [
            "${workspaceFolder}/**",
            "${vcpkgRoot}/x64-osx/include",
            "/usr/local/Cellar/opencv/4.3.0_5/include/opencv4",
            "/Users/Documents/leptonica/build/",
            "/Users/Documents/tesseract/build/"
        ] 

And in settings.json:

  "cmake.configureSettings": {
    "CMAKE_TOOLCHAIN_FILE": "${vcpkgRoot}/scripts/buildsystems/vcpkg.cmake
  }

But i keep getting the same error, i'm not even specifying libzip as a target, only libzippp, so i'm guessing there's something going on with an internal dependency? where is libzippp looking for libzip??

I'm new to C++ and CMake! easy to understand examples/explanations are appreciated :)

You can assume i've tried a lot of SO question solutions and tutorials to try and solve this, asking this question is my final resource

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
Alejandro Camba
  • 978
  • 10
  • 25
  • You shouldn't need to specify both (remove `libzip::libzip`). Then, did you try deleting your CMakeCache.txt and re-running CMake from *scratch*? – Kevin Jul 20 '20 at 12:56
  • 1
    Yes and yes! Leaving libzippp::libzippp behaves the same way and throws the same error, and i did delete cache and re-ran but error remains @squareskittles – Alejandro Camba Jul 20 '20 at 13:59

0 Answers0