3

I have a project which depends on cpprestsdk, tinyxml2. I run this project on another computer which has no internet connection, I installed these libraries with vcpkg, I was wondering should I statically link these libraries to my solution or use the new export command and create a nuget package and install it on my friend's computer.

Edit: I want to say that I don't need to run the generated .exe file, I want to take the whole visual studio solution.

Rathma
  • 1,196
  • 2
  • 33
  • 65

2 Answers2

2

If you want to take the whole VS solution over, the easiest way to get started is to export a NuGet package.

Later on, if you want to update the dependencies or install new ones, you can always transition to a full Vcpkg instance by removing the NuGet package from the solution.

roschuma
  • 536
  • 4
  • 7
  • thanks for your answer, I didn't get your last sentence, the other computer doesn't even know what vcpkg is :), He tell my just pass me the solution and I want to build. – Rathma Nov 29 '17 at 08:26
2

In 2021 it seems like the best way to do this is to use vcpkg manifests. Here's an example vcpkg.json:

{
    "name": "myproject",
    "version-string": "0.0.1",
    "dependencies": [
        "cpprestsdk",
        "tinyxml2"
    ]
}

I would just place the vcpkg.json next to the .sln and enable vcpkg manifests. I believe other users of the project have to install vcpkg themselves still, but maybe msbuild can bootstrap it.

Dan O
  • 4,323
  • 5
  • 29
  • 44
  • 1
    You will soon run into https://stackoverflow.com/questions/66196821/unable-to-reference-pocosqlite3-using-vcpkg-manifest when your vcpkg install commands specify features like `poco[sqlite3]` – OneWorld Aug 16 '21 at 14:26