


So it is necessary to add the include directories typically to all configurations. If we add the include directories to this configuration, and then later switch to Debug in the IDE, the build will fail not finding the ZLib headers. Note that all this information is defined per configuration, in this image, the Release - 圆4 configuration is being changed. For defining the include directories, it is necessary to go to the C/C++ -> Preprocessor -> Additional Include Directories: Adding possible preprocessor definitions that the library might require for proper behavior.Īll these tasks can be done interactively in the IDE, going to the project view, right click and open “Properties”.

Adding the library directories where these libraries can be found.Adding the libraries that needs to be linked, like zlib.lib.Adding the include directories where headers like zlib.h can be found.A team of developers could decide that they will put all of their dependencies in “C:\TeamDeps”, and the process to add such information to our project typically involve some steps: Let’s imagine that we need some compression capabilities in our project and we want to use the popular ZLib library for that purpose. Let’s start by manually adding an external library to one existing project. vcxproj files and property files, and how they can be leveraged to define C++ dependencies to external libraries in a systematic and scalable way. This post introduces the syntax of Visual Studio. Fortunately, MSBuild, the build system used by Visual Studio, allows defining external user property files (those are XML files), which makes an interesting extension point for automation and standardization of many tasks. It is very common that developers manually add information to the project manually in the IDE, but this method is difficult to maintain over time. Visual Studio C++ is the most popular IDE and compiler in Microsoft Windows platforms, massively used by C and C++ developers. Building C and C++ projects is hard, and maintaining the dependencies information inside C and C++ projects is hard. Dependencies in C and C++ projects are hard.
