0

I'm on a windows 10 machine. I have installed cpprestsdk using vcpkg

vcpkg install cpprestsdk 

My CMakeLists.txt has the following lines

find_package(cpprestsdk CONFIG REQUIRED) target_link_libraries(${PROJECT_NAME} PRIVATE cpprestsdk::cpprest cpprestsdk::cpprestsdk_zlib_internal cpprestsdk::cpprestsdk_boost_internal cpprestsdk::cpprestsdk_brotli_internal) 

running

cmake -GNinja .. -DCMAKE_TOOLCHAIN_FILE="C:\Program Files\vcpkg\scripts\buildsystems\vcpkg.cmake" 

gives me the following error

Make Error at C:/Program Files/vcpkg/scripts/buildsystems/vcpkg.cmake:250 (_add_library): Target "<target_name_hidden>" links to targe "cpprestsdk::cpprestsdk_boost_internal" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an 

ALIAS target is missing?

1
  • Normally "internal" prefix/suffix in a name means this name is internal to implementation and shouldn't be used outside. Why do you use cpprestsdk::cpprestsdk_zlib_internal instead of simple find_package(ZLIB)? Commented May 12, 2020 at 9:50

1 Answer 1

0

find zlib - find module introduces interface library cpprestsdk_zlib_internal which doesn't have install instructions so will not be available in namespace cpprestsdk and wasn't imported

Sign up to request clarification or add additional context in comments.

2 Comments

If I remove cpprestsdk::cpprestsdk_boost_internal but keep the cpprestsdk::cpprestsdk_zlib_internal it works fine. What is it exactly that you're asking me to do here? @vsh
infact installing via vcpkg suggests this find_package(cpprestsdk CONFIG REQUIRED) target_link_libraries(main PRIVATE cpprestsdk::cpprest cpprestsdk::cpprestsdk_zlib_internal cpprestsdk::cpprestsdk_boost_internal cpprestsdk::cpprestsdk_openssl_internal)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.