question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use vcpkg

See original GitHub issue

Hello,

I am trying to use vcpkg on Ubuntu with vscode. After I install the vcpkg, did the bootstrap and run sudo ./vcpkg integrate install. The console output:

Applied user-wide integration for this vcpkg root.

CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=/path_of_vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake"

Then, I install a library vckpg install cppzmq. The console output is:

...
The package cppzmq:x64-linux provides CMake targets:

    find_package(cppzmq CONFIG REQUIRED)
    target_link_libraries(main PRIVATE cppzmq libzmq cppzmq-static libzmq-static)

Based on the first output, i edited the vscode user settings file settings.json by adding following entry:

"cmake.configureArgs": [
        "-DCMAKE_TOOLCHAIN_FILE=/path_of_vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake"
    ]

After build, I got error:

[cmake] CMake Error at CMakeLists.txt:169 (find_package):
[cmake]   Could not find a package configuration file provided by "cppzmq" with any
[cmake]   of the following names:
[cmake] 
[cmake]     cppzmqConfig.cmake
[cmake]     cppzmq-config.cmake
[cmake] 
[cmake]   Add the installation prefix of "cppzmq" to CMAKE_PREFIX_PATH or set
[cmake]   "cppzmq_DIR" to a directory containing one of the above files.  If "cppzmq"
[cmake]   provides a separate development package or SDK, be sure it has been
[cmake]   installed.
[cmake] 
[cmake] 
[cmake] Configuring incomplete, errors occurred!
[cmake] See also "/home/rong/projects/SGX/code/MajordomoServer/build/CMakeFiles/CMakeOutput.log".
[cms-driver] Error during CMake configure: [cmake-server] Configuration failed.

After a bit search, I can see a file ‘cppzmqConfig.cmake’ is in path_of_vcpkg/vcpkg/buildtrees/cppzmq/x64-linux-dbg/cppzmqConfig.cmake, So I tried to edit settings.json

"cmake.configureArgs": [
        "-DCMAKE_TOOLCHAIN_FILE=/path_of_vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake",
        "-DCMAKE_PREFIX_PATH=path_of_vcpkg/vcpkg/buildtrees/cppzmq/x64-linux-dbg/cppzmqConfig.cmake"
    ]

But the same error still pops up.

Based on https://docs.microsoft.com/en-us/cpp/vcpkg, The only thing I need is adding “-DCMAKE_TOOLCHAIN_FILE” when configuring ‘cmake’. Any suggestions about how to configure CMAKE_TOOLCHAIN_FILE correctly by using CMake Tools plugin?

Environment: Ubuntu 16.04 LTS VSCode 1.23.1 VSCode plugin CMake Tools 0.11.1 VSCode plugin CMake 0.0.17 CMake version: 3.11.1 Clang 7.0 vcpkg 0.0.113

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:13
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
shelpercommented, Mar 29, 2020

Is this solved? i have the same problem using cmake and vcpkg and vscode on windows.

3reactions
YangRongAtGitcommented, Jun 6, 2018

Thanks for you reply VOB. You are definitely a OpenGL fan, aren’t you? I tried to use the vcpkg without vs code. Just manually config CMake by using ccmake .. -DCMAKE_TOOLCHAIN_FILE=path_of_config_file.cmake in a build folder. It is not working. (More details in the link https://github.com/Microsoft/vcpkg/issues/3655). I think I will wait for suggestions or a fix for that issue before trying other things. Thanks again. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use vcpkg installed packages in Visual Studio in reality?
You clone vcpkg, run the build script, and do a one-time vcpkg integrate install . Literally at the top of the readme file...
Read more >
Frequently Asked Questions - vcpkg - Read the Docs
I can't use user-wide integration. Can I use a per-project integration? How can I remove temporary files? How is CMake used internally by...
Read more >
Get started with vcpkg
Installing vcpkg is a two-step process: first, clone the repo, then run the bootstrapping script to produce the vcpkg binary. The repo can...
Read more >
Internal compilig error while building fizz library from vcpkg
Hello, I install the depend libraries(folly, OpenSSL, libsodium) by using vcpkg first, then install the fizz library, but it failed, and the cache...
Read more >
vcpkg integration with Visual Studio 2022 doesn't work on a ...
for use-wide integration with Visula Studio 2022. However, my bamboo build agent builds are failing because they can't find my vcpkg packages. I ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found