I want to use the zlib library in my c++ project. So, I have downloaded zlib library(zlib_1_2_8_msvc2015_64.zip).
Then, I have created zlib folder under "C:\Program Files\Zlib". Then, Extract zlib_1_2_8_msvc2015_64.zip file into "C:\Program Files\Zlib".
After that, I have opened visual studio 2017 and goes to property => C/C++ => general => additional include directories and
added that path : "C:\Program Files\Zlib\msvc2015_64".
After that, I have added #include <zlib.h> header file in my project. but, not working.
So, How to use zlib library in visual studio 2017?
For static library installation , include the zlibstatic.lib and directories in the linker additional libraries and directories. For dynamic library , include the zlib.lib in the linker and copy the zlib.dll to the project output directory.
Another option is to install vcpkg ( MS packager to install windows based open source projects) and use powershell command like so .\vcpkg install zlib:x64-windows-static. The zlib can be auto integrated to your project using .\vcpkg integrate install
You have specified where to find the header files.
You also need to find which library to bind and where to find it.
For Visual Studio 2012:
In linker section -> General -> additional library directories, you can specify the path where the library resides
In linker section -> Input -> additional dependancy , you can specify the actual lib name to bind
Its a simple fix copy all contents of msvc2015_64 directory into zlib directory and you are good to go.
Related
I needed to use zydis library in my VC2019 cpp project.
I have no idea how can I add it to my current project - I downloaded it from github.
There is msvc folder, inside I can find .sln file, some header files and .vcxproj files - what should I do, to just include it into my project and use it?
It can be done by adding a reference to the DLL file.
In Visual Studio, right click on the project, Add Reference. Give the path to the DLL file and add it to the project.
First, I suggest that you could download and install Zydis using the vcpkg dependency manager. The method is easy and convenient.
If you don't use vcpkg, you could follow the steps below.
Open the Zydis.sln in msvc with VS2019.
Copy files in include/Zycore, put them in zydis-master\include\Zycore. Because I find that there should be missing files when I compile Zydis.sln.
Right click Zydis, set Visual Studio 2019(v142) in Properties->General->Platform Toolset.
Compile it, and you will find Zydis.lib in zydis-master\msvc\bin\DebugX64.
Then, you could copy include floder and lib in your program floder.
You could set VS:
Right-click the project, select Properties->Configuration
Properties->C/C++->General, find the Additional Include Directories and set the directory.
Properties -> Configuration Properties -> Linker ->
General, find the Additional library directory in General, and set the lib.
Properties -> Configuration Properties -> Linker -> Input,
find Additional Dependencies and input the lib name.
Besides, you could set five build configurations.
I'm building a static library using Visual Studio, which involves installing nupengl and glm. Then I linked it to a test project via this method :
Project Properties -> VC++ Directories -> Additional include library (I entered the directory which contains my header files from the library)
Project Properties -> Linker -> Input (I entered the directory which contains the .lib file for the library)
I added the header files in the library to my test project
But when I run the test program, it produces things like :
GLFW/glfw3 not found
How can I use the installed NuGet package for the library when calling the library from another project ? Any help would be highly appreciated
Hello I am trying to install this library for use in one of my visual studio projects.
I know I have to go to \project properties-linker-general-additional library Directories but once I get there I don't know what to do.
I am stuck here :
Here's a step-by-step tutorial for installing, (optionally) building, and referencing boost in Windows: http://www.boost.org/doc/libs/1_61_0/more/getting_started/windows.html#get-boost
Obtain a copy of boost and put it to a folder boost_root (name as you please). If you haven't done it already, the easiest way is to get a precompiled zip from boost
Find the directory where your boost binaries are located. It usually is under the lib subdirectory, ie boost_root\libs.
Under the Additional library directory of visual studio (the one you mention in your post), enter the full or relative path to the boost dll directory, ie path_to_boost_root\boost_root\libs
I download pthread-w32-2-9-1-release.zip, unzip it and use Prebuild/include lib and dll with VisualStudio2013.
I set up a VC++ empty project "helloc" with main.c, then write a simple example with pthread_create pthread_join functions.
This is my configure:
Properties->C/C++->General->Additional Include Directories, add "F:\pthread_win32\include"
Properties->Linker->General->Additional Library Directories, add "F:\pthread_win32\lib\x86"
Properties->Linker->Input->Additional Dependencies, add "pthreadVC2.lib"
And it's successfully build, but when I click "Local Windows Debugger", the console break with "helloc.exe error because cannot find pthreadVC2.dll".
Then I copied pthreadVC2.dll to helloc/Debug/, same directory with helloc.exe, finally it's working.
But I don't know why the pthreadVC2.lib and pthreadVC2.dll are both required by helloc.exe. Is it a must that both lib and dll being used in VisualStudio ?
If only one of them (pthreadVC2.lib pthreadVC2.dll) is enough to support helloc.exe, how can I specify which one (dll or lib) I want to use in VisualStudio with helloc.exe ?
And I don't want to put all pthread libs and dlls into "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC", I want to know how to configure manually.
AFAICT, the pre-built library is just an import library for the DLL. (Allowing you to link against the DLL, hence required)
If you want to link statically, you'll have to rebuild the library yourself. See the README file for more information.
I'm using Boost C++ Libraries v1.47 to serialize an class (I used the installer and selected everything and for VS2010).
But I get a error from my Visual Studio 2010 linker "Lnk1104 Can not open libboost_serialization-vc100-mt-gd-1_47.lib". I set up the "c:\program files\boost\boost_1_47" for my includes and "c:\program files\boost\boost_1_47\lib" for my libs. I don't know what's going wrong.
Update
I don't know why but if I put the lib files from the boost directory to "c:\program files\Microsoft Visual Studio 10.0\VC\lib" everything work fine. Boost load the lib files
somehow dynamical.
If you cannot find the file on your computer with the windows searcher just ask anybody else who uses boost to give you a copy of that file (libboost_serialization-vc100-mt-gd-1_47.lib).
My friend from work used to have the same trouble after having installed boost, there was just not the file in the boost folder. At the same time I picked up the file successfully so we copied it to the right directory on his computer.
For some reason precompiled libs in the installer are named on format "boost-module-vc100..." and headers specify library name as "libboost_module-vc100...". So you should specify library name in project settings to make it linked correctly.
I solved this issue by compiling all boost libraries by myself. With modern PC it won't take too long to do.
to resolve this problem,
go to properties -> Linker -> General -> Additional Library Directories
Enter the path of boost:
Boost-path\stage\lib