| description | Learn more about: Porting third-party libraries | ||
|---|---|---|---|
| title | Porting Third-Party Libraries | ||
| ms.date | 10/29/2019 | ||
| helpviewer_keywords |
|
||
| ms.assetid | b055ed20-8a9e-45b2-ac2a-e3d94271c009 |
When you upgrade a project from Visual Studio 2013 or earlier to the current version of Visual C++, you also have to upgrade any libraries that the project uses, so that the library and your project are built with the same version and flavor of the compiler. If you do not have access to the library source code, and the library is not available through vcpkg, then you must obtain an updated binary from the library vendor. (For more information, see Overview of potential upgrade issues).
When upgrading an application from Visual Studio 2015 or Visual Studio 2017 to Visual Studio 2019, it isn't necessary to upgrade dependencies because the code generated by those three versions is binary-compatible. For more information, see C++ binary compatibility between Visual Studio 2015 and Visual Studio 2019.
In the past, finding and upgrading 3rd party libraries was sometimes a non-trivial task. To make it easier to acquire and rebuild C++ 3rd party open-source libraries, the Visual C++ team has created a command-line tool called the VC++ Packaging Tool or vcpkg. Vcpkg has a searchable catalog of many popular C++ open-source libraries. You can install any library in the catalog directly from the vcpkg command line. When you install a library, Vcpkg creates a directory tree on your machine and adds the .h, the .lib and binaries in this folder. You can use this folder in your compilation command line, or integrate it into Visual Studio 2015 or later by using the vcpkg integrate install command. After you integrate a library location, Visual Studio can find it and add it to any new project that you create. To use a library, just #include it, and Visual Studio will automatically add the .lib path to your project settings and copy the dll to your solution folder. For more information, see vcpkg.
If your open-source library is not present in vcpkg catalog, you can open an issue on the GitHub repo where the community and the Visual C++ team can see it and potentially create the port file for this library.