I am having some difficulties understanding how to link the header files of libpqxx. I have generated the output using CMake and then built the Release x64 version of it using Visual Studio. When I go to #include the headers, I can't #include them. According to the documentation, there should be as the header, but when I try and enter that, it gives me an error. I have tried to go into the project settings and set the include folder of the built version of libpqxx as an additional include dependency.
Does anyone happen to have any experience with this?
Thanks!!
Related
I need my project to be able to use json format.
I was suggested this github : https://github.com/open-source-parsers/jsoncpp
I have been trying to integrate it to my project for multiple hours and still cant find the issue.
I still get these errors on my include :
#include <jsoncpp/json/json.h>
E1696 cannot open source file "jsoncpp/json/json.h"
C1083 Cannot open include file: 'jsoncpp/json/json.h'
I tried to go to C/C++ General->Additional Include Directories>
to add the "jsoncpp-master\include" directory
also tried "jsoncpp-master\include\json" directory
also tried to add the .h and .cpp found in the repository directly.
I have also tried a multitude of other things but I'm not sure it would be relevant to list them all here.
I was not able to find instructions to use it with Visual Studio 2022 on their github either.
Safest and most convenient way to use third party libraries is to use package manager like vcpkg
https://vcpkg.io/en/index.html
https://github.com/microsoft/vcpkg
Choose what build you want x86 or x64 and set default triplet in your environment variables
VCPKG_DEFAULT_TRIPLET
x64-windows - DLL Build 64-bit windows
x86-windows - DLL Build 32-bit windows
x64-windows-static - Static Build 64-bit windows
x86-windows-static - Static Build 32-bit windows
If you have added jsoncpp-master\include to C/C++ General->Additional Include Directories then you should use #include <json/json.h> instead of #include <jsoncpp/json/json.h>
Explanation : The compiler is looking inside the include directory. If you observer the file structure you can see json folder is located in the include directory and not jsoncpp.
This might seem like an obvious problem, but I'm struggling to include the DIPlib library into my C++ project.
I'm using Windows 10, 64-Bit and CLion (or alternatively Visual Studio 2017 Enterprise with R#). I'm currently using CMake, but I'd be open to other solutions as well.
However, I could only find a download link for the DIPimage package (which seems to be an installer).
I did already install this, but I (obviously) still can't use the library in my project.
I simply couldn't find a way to include this type of library.
The documentation does however mention some include files to include, which I found in the dipimage_2.9_win64.zip, but how am I supposed to include these? Or do I have to include the libdip.dll, which can be found in the same zip?
I'm trying to include the Armadillo C++ library, a linear algebra library, in a C++ project I'm working on, and I'm having a difficult time figuring out how to do so. I'm unfamiliar with how to add libraries to a project in general, so I've been searching for a resource that has step by step instructions, and the best one I could find didn't work for me (http://codeyarns.com/2013/11/15/how-to-use-armadillo-on-windows/). I followed all the instructions on the web page, and Visual Studio still complains when I put #include <armadillo> and using namespace arma in my code. Does anyone have any idea what I'm doing wrong?
I have put all the .lib and .dll files in a directory which is added to the PATH system environment variable
and then you just have to add the correct include and library directories in VS2015
and add the lib dependencies you have
I'm having a lot of trouble linking my project with FreeImage library with VSE 2013
I've followed this answer for VS2010 to no avail: Linking FreeImage as a static library in VS2010?
I am getting LNK2019 errors when calling FreeImage functions.
I've linked the library just as I would any library. Below are the following steps I made:
Download FreeImage Source.
Open the 2008 Solution (converted to 2013) and changed Code Generation to /MDd for all projects
Attempted to build project but for some reason min/max functions were not defined So I included algorithm.h to those files and that stopped those errors.
Attempted to build project and I get an error: "Could not open "afxres.h". So I swapped afxres.h with windows.h as suggested in another topic.
Built the project -> success
Copied Fresh FreeImaged.lib to to my project
Added directory to "Additional Library Directories"
Added FreeImaged.lib to Additional Dependencies under linker
Copied FreeImaged.dll to my debug folder where the .exe is being built
Added FreeImage.h to the project
Added #define FREEIMAGE_LIB before including the header
Attempted to build my project -> LNK2019s everywhere.
If anyone has been able to build FreeImage on VS2013 and could share how they did it I would greatly appreciate it, or if anyone has any suggestions.
The reason for your troubles is that with Visual Studio 2013 some breaking changes (as outlined by Microsoft) were introduced in related to C++11 conformity.
One includes that in order to use std::min()/std::max(), you now have to include the header . This also concerns FreeImage. Unfortunately, up until version 3.6.1 (the most recent as of today) this hasn't been fixed yet.
This blog post explains what you need to do to get it to compile. The most relevant part is:
Specifically, you will need to add
include <algorithm>
to the following files:
Source/OpenEXR/IlmImf/ImfOutputFile.cpp
Source/OpenEXR/IlmImf/ImfScanLineInputFile.cpp
Source/OpenEXR/IlmImf/ImfTiledMisc.cpp
Source/OpenEXR/IlmImf/ImfTiledOutputFile.cpp
Source/OpenEXR/Imath/ImathMatrixAlgo.cpp
I was able to get this to work by going into the Configuration Manager unchecking FreeImage and checking FreeImageLib under build. Also disabling whole program optimization seems to make the binary size more normal and, gets rid of warnings when linking.
I know this question is over a year old. Just providing an answer to anyone google searching this problem like me.
version: FreeImage3170Win32Win64.zip
os.env.: win7 64bit visualstudio ULTIMATE 2013
operation:
1_ just unpacking the zip somewhere
e.g. (D:/library/FreeImage3170Win32Win64/FreeImage)
2_ in C/C++->General->Additional Including Directerories
add (D:/library/FreeImage3170Win32Win64/FreeImage/Dist/x32)
3_ in Linker->General->Additional Library Directerories
add (D:/library/FreeImage3170Win32Win64/FreeImage/Dist/x32)
4_ in Linker->Input->Additional Dependency
add (FreeImage.lib)
PS0: i just add a new entry to Include Directories and Library
Directories and FreeImage.lib to Linker->input in Visual Studio without rebuild the FreeImage library
:)
PS1: error LNK2019 occured when i added the FreeImage/Dist/x64 option
;( ( got no idea about this)
maybe this helps :)
I'm trying to compile one of my projects on Windows 7, using Visual Studio 2013. I've installed Boost 1.53 and setup the solution using cmake.
What happens is that now the compiled libraries of boost are in the form libboost_*-vc120-mt(-gd)-1_53.lib. In the linker project options, under the input tab, I have verified that the libraries that I need are there, and in fact the compiler is able to correctly read them.
However, for some reason that I absolutely can't understand, the linker is also trying to find libraries compiled as vc110. For example:
error LNK1104: cannot open file 'libboost_filesystem-vc110-mt-gd-1_53.lib'
The Platform Toolset that is listed in the project option is "Visual Studio 2013 (v120)". I couldn't find any reference to vc110 in any of the project options. Can you help me understand what is happening?
This post thankfully solves my question. I wasn't able to find it before. The solution is to edit the boost/config/auto_link.hpp because the code inside is not able to handle vc120, and ends up suggesting vc110
How do I specify, which version of boost library to link to?
The library name is autogenerated in the boost header version.hpp
Possibly the version wasn't rebuilt, or you are pointing at the wrong header version?
Instead of patching the config file try just defining a macro before the header inclusion .. this is what I did in my project
//#define BOOST_LIB_TOOLSET "vc100"
//#include