How to remove vcpkg and all libraries installed with vcpkg - vcpkg

How does one completely remove vcpkg and all installations/system changes made by it?
I recall seeing some FAQ about vcpkg where it said that you could just delete the vcpkg folder. However, I've been trying to find that same FAQ for over an hour now, to no avail. Also "just delete the folder" being the solution seems implausible to me, since I would assume vcpkg changes some environment variables or other settings, as well as the integration with Visual Studio that I was trying to use. Online search on this topic only yielded people discussing how to remove multiple installed libraries at once, with no clear solution even to that problem (I would be interested in this as well). The vcpkg website itself seems to offer no answers to this question.
edit: I found the page saying "just delete the folder" at docs.microsoft.

The documentation page https://learn.microsoft.com/en-us/cpp/build/vcpkg offers the instruction how to uninstall:
Uninstall vcpkg
Just delete the directory.
It could also mention that removing the vcpkg directory completely actually uninstalls all the installed libraries (all ports), because the vcpkg directory is the sole place where vcpkg.exe deploys any files.
Additionally, if you did run vcpkg integrate install, then you may also run vcpkg integrate remove to remove the user-wide (global) integration.
vcpkg integrate remove Remove user-wide integration

Related

vcpkg integrate install missing on macOS/Linux

The vcpkg helps to manage libraries for C++ projects on Windows/macOS/Linux.
On Windows one can
vcpkg integrate install
https://vcpkg.readthedocs.io/en/latest/users/integration/
But outside Windows that does not seem to exist. Am I wrong?
That end up making CMakeLists.txt made on Windows not portable to macOS/Linux. While migrating a project from Windows to macOS I found I have to add
include_directories(~/vcpkg/installed/x64-osx/include)
otherwise make will fail to find header files.

libgit2 dependency pcre not present in build

I'm building a C++ app which uses the libgit2 library to interact with a git repo. I've installed libgit2 through vcpkg, which also installed the pcre library which libgit2 needs. So far, so good. When I build my project there is no issue, only when I launch the app it throws an error that pcre.dll is not present. This is correct, pcre.dll isn't in my output folder as none of my code has any interaction with it. Libgit2 needs it.
How can I get the dependency of the dependency to be included in my final build?
Pcre is present and accounted for, but none of my code uses it so it doesn't get included in the build of my app. The git2.dll does get included with the build. The paths that need to be added to Visual Studio are there, managed by vcpkg. Everything is setup so that pcre could be included in a build if need be.
I use libgit2 v 1.1.0, Visual Studio 2019 and the latest stable version of vcpkg.
I'm running into the same issue and have opened a PR: https://github.com/microsoft/vcpkg/pull/18289
Based on Neumann-A's feedback in the PR, it looks like there may be a bug preventing the pcre DLL from getting copied to the release/deployment files. For now, you're welcome to use my vcpkg fork which exposes the "builtin" REGEX_BACKEND CMake option, which works around this problem. https://github.com/motevets/vcpkg/tree/fix-libgit2

Installing boost library on windows not working (no console output at all)

I am trying to install the boost library on windows 10, the first few steps are working:
Downloading the library
Unzipping
Bootstrapping
But then when trying to run b2.exe or bjam.exe there is nothing happening (except high CPU load), but no console output whatsoever, not even an error.
I can't find any explanation or help on the internet, maybe some of you got an idea
Since you've mentioned you're working on Windows, maybe Visual Studio is appropriate for your choice. In such case, you can use vcpkg tool to install boost. Check this link.
Once the tool is installed, it's really easy to install various libraries and they will automatically be detected in your Visual Studio projects. To install boost simply run vcpkg install boost:x64-windows.

vcpkg setup errors on command line

I am trying to compile dlib 19.4 using the vcpkg tool
since I am having trouble compiling CMAKE and working with Boost.Python
to fix compiler issues for dlib.
Though I am having problems even running the basic steps
to get the vcpkg package to work:
(I also downloaded Visual Studio 2017 for this tool)
Looking at executed command (git init), you initialized empty git repository for vcpkg - that is likely wrong. This bootstrap.ps1 script fails internally when trying to fetch existing revisions. vcpkg doesn't want to reside in just any git repository, it wants "its" git repository. vcpkg uses git as a distribution platform and later to perform updates.
So instead, you should clone vcpkg repository to some directory, e.g.:
C:\test>git clone https://github.com/Microsoft/vcpkg.git vcpkg_test
Cloning into 'vcpkg_test'...
...
Checking out files: 100% (876/876), done.
C:\test>cd vcpkg_test
C:\test\vcpkg_test>powershell -exec bypass scripts\bootstrap.ps1
https://github.com/Microsoft/vcpkg/
Additionally I see errors regarding VS2017 C++ support. VS2017 is an IDE with multiple optionally supported languages (i.e. you could have only C# support installed). Please make sure you have "Desktop development with C++" workload installed - as vcpkg is for C++. You can update the installation at any time by running installer again (Modify).
https://learn.microsoft.com/en-us/visualstudio/install/install-visual-studio

Fixing MinGW Installation on Windows 8

While helping my friend spin up MinGW and a C++ environment on his Windows 8 computer, I ran the get-mingw script and waited as it ran through all the mirrors for required downloads. However, three downloads completely failed:
libltdl - installer script hung and then moved on after pressing "OK"
automake-1.11 - installer script tried finding 1.10, then 1.9, then 1.8, then 1.7 (all of which failed) until finally settling on 1.6
mktemp - script hung and moved on after pressing "OK"
In all three cases, the script gave me a nice error log upon completion, showing that a majority of packages had been downloaded and installed except for these three, which showed up as errors. However during the installation process I had simply gone to the MinGW sourceforge page and manually found and downloaded each .bin.tar.lzma file that was missing.
Now that I have them, is there a good accepted way to unpack and plug them into my friend's existing MinGW install? In case it's tough, I'm comfortable with unix and dos command line so I'll be able to move executables into the MinGW/bin folder if that's what's needed, I just want to check for the best way to 'fix' the install.
As a side note - even though the error log says these are required packages, adding MinGW/bin/ to the PATH still allows for use of gcc and g++, although not make (possibly because of automake failure?). Is this standard behavior?
Firstly, the package issue can be fixed by using the MinGW installer - keep the packages selected and go to "apply changes" and the script will probably try to redownload the missing packages. I think the original problem was probably just a shoddy wifi connection during repository connection.
However, I then ran into a problem where I tried to run gcc and it gave me a missing -lpthread error ... but this question was able to help me fix that, and gcc and g++ are working fine now (haven't opened and tested Eclipse yet though). Just in case of link decay, the issue I cited arises from the MinGW installer script not downloading the lpthread library upon installation. To fix that issue, quoted from link:
Just run and open MinGW Installation Manager, which should be pre-installed with MinGW, select "All Packages" on the left panel, and on the right panel, search for "mingw32-pthreads-w32" packages and install them.
I think the Installation Manager has libpthread and pthread available for install, and pthread libs were the ones that seemed to solve it for me.