Vcpkg: 'vcpkg integrate install' not working

Created on 4 Oct 2018  路  2Comments  路  Source: microsoft/vcpkg

What can I do if vcpkg integrate install is not working for me? It has worked a few months ago.

I've updated vcpkg and done the obvious stuff:

git pull
.\bootstrap-vcpkg.bat
.\vcpkg integrate install  # <-- Tried both with and without admin rights

Then open VS (all instances were closed before), create a new C++ Windows Desktop => Console app.
#include <opencv2/core.hpp> ==>

fatal error C1083: Cannot open include file: 'opencv2/core.hpp': No such file or directory

I also tried with quotes #include "opencv2/core.hpp".

OpenCV is of course installed. Other libraries I've got installed do not work either (nothing does).

 .\vcpkg list
opencv:x64-linux                                   3.4.1            computer vision library
opencv:x64-windows                                 3.4.1            computer vision library
opencv:x64-windows-static                          3.4.1            computer vision library
opencv:x64-windows-static-with-dynamic-crt         3.4.1            computer vision library
...

Most helpful comment

The first obvious thing to check: all the listed libraries you've installed are for 64-bit. Are you targetting x64 with your project?

Next, increase the MSBuild log verbosity to "Normal" (Ctrl-Q -> Build and Run -> MSBuild project build output verbosity) and rebuild. If the integration is hooked up at all, you should see a message like:

1>Target VcpkgTripletSelection:
1>  Using triplet "x86-windows" from "D:\src\vcpkg\installed\x86-windows\"

All 2 comments

The first obvious thing to check: all the listed libraries you've installed are for 64-bit. Are you targetting x64 with your project?

Next, increase the MSBuild log verbosity to "Normal" (Ctrl-Q -> Build and Run -> MSBuild project build output verbosity) and rebuild. If the integration is hooked up at all, you should see a message like:

1>Target VcpkgTripletSelection:
1>  Using triplet "x86-windows" from "D:\src\vcpkg\installed\x86-windows\"

Oh man! VS still uses 32-bit as the default... I usually use CMake, and very rarely have to use "plain" VS projects. That was it, thank you! Feels a bit stupid now :-) Normally it would at least find the headers in these scenarios and then complain about the x32/x64 mismatch when linking, and then it's pretty obvious. But of course in this case vcpkg would only add the include paths to the 64-bit configuration.

It sort of feels like a flashback and that I ran into this before... not sure it's worth a note in the documentation though, as it was clearly my bad and it's obvious, afterwards. Maybe this issue will help the next person (or future me, in a year when I've forgotten and this will happen again) - I searched through the issues before posting and couldn't find anything related.

Thanks again!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aspioupiou picture aspioupiou  路  3Comments

spindensity picture spindensity  路  3Comments

jasjuang picture jasjuang  路  3Comments

pakdel picture pakdel  路  3Comments

jack17529 picture jack17529  路  3Comments