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:
Download and install zlib library on your system. Make a note of the zlib installation directory.
Open Visual Studio and create a new project or open an existing project.
Right-click on the project name in the Solution Explorer window and select Properties.
In the left pane of the project properties popup window, navigate to Configuration Properties > C/C++ > General.
In the right pane, scroll down to Additional Include Directories and click on the value field.
Click the down arrow at the end of the value field and select Edit.
In the Edit dialogue box, add the path of the zlib include directory (which contains the header files) that you noted earlier.
Click on OK to save the changes and close the Edit dialogue box.
Now in the left pane of the same window, navigate to Configuration Properties > Linker > General.
In the right pane, scroll down to Additional Library Directories and click on the value field.
Click the down arrow at the end of the value field and select Edit.
In the Edit dialogue box, add the path of the zlib lib directory (which contains the library files) that you noted earlier.
Click on OK to save the changes and close the Edit dialogue box.
Now, in the left pane of the same window, navigate to Configuration Properties > Linker > Input.
In the right pane, scroll down to Additional Dependencies and click on the value field.
Click the down arrow at the end of the value field and select Edit.
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).
Now, you can build and run your project with external zlib library support.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-05-21 07:37:00 +0000
Seen: 16 times
Last updated: May 21 '23
What does an empty name signify in the inotify_event structure in the C++ language?
What is the method to get a printable output of a C++11 time_point?
What are the differences between TREEFROG, CROW, and the CPPCMS C++ framework?
How can the NTP flag be set for Linux time in C++?
What is the process of redefining a c++ macro with fewer parameters?
What are some other options instead of Scipy to compute CubicSpline?
How can a list be sorted alphabetically within a console application?