Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To use an external version of zlib while constructing libboost-iostreams in Visual Studio 2019 using Boost version 1.81, you can follow these steps:

  1. Download and install zlib library on your system. Make a note of the zlib installation directory.

  2. Open Visual Studio and create a new project or open an existing project.

  3. Right-click on the project name in the Solution Explorer window and select Properties.

  4. In the left pane of the project properties popup window, navigate to Configuration Properties > C/C++ > General.

  5. In the right pane, scroll down to Additional Include Directories and click on the value field.

  6. Click the down arrow at the end of the value field and select Edit.

  7. In the Edit dialogue box, add the path of the zlib include directory (which contains the header files) that you noted earlier.

  8. Click on OK to save the changes and close the Edit dialogue box.

  9. Now in the left pane of the same window, navigate to Configuration Properties > Linker > General.

  10. In the right pane, scroll down to Additional Library Directories and click on the value field.

  11. Click the down arrow at the end of the value field and select Edit.

  12. In the Edit dialogue box, add the path of the zlib lib directory (which contains the library files) that you noted earlier.

  13. Click on OK to save the changes and close the Edit dialogue box.

  14. Now, in the left pane of the same window, navigate to Configuration Properties > Linker > Input.

  15. In the right pane, scroll down to Additional Dependencies and click on the value field.

  16. Click the down arrow at the end of the value field and select Edit.

  17. In the Edit dialogue box, add the following libraries with a semicolon separator:

zlib.lib

boostiostreams-vc141-mt-s-x32-x64-181.lib

Note: The name of the boost_iostreams library may vary depending on your Boost version, architecture (32-bit or 64-bit), and configuration (static or dynamic).

  1. Click on OK to save the changes and close the Edit dialogue box and then click on OK to close the project properties window.

Now, you can build and run your project with external zlib library support.