I'm working on windows. How to include the CDS library in VS project? I could not find 'include' directory, nor 'lib' directory.
http://libcds.sourceforge.net/doc/cds-api/index.html
It seems to be a header only library, just put it in a folder and add a include directory to that folder with visual studio under Properties->VC++ Directories->Include Directory and then all you have to do is
#include <FolderWhereCDSIsAt\allocator.h>
or
#include <FolderWhereCDSIsAt\cache_line.h>
Related
I am new to c++. I have creating a previous copy of the exe application and using the ssleay32.dll and libeay32.dll in visual studio 2017. I have added its path in the C++/General/Include directories and Linker/Input/Additional Dependencies and VC++/Include directories and added the dll in debug folder and current directory. but still cannot figure out what I am doing wrong.
I am unable to include the <openssl/ssl.h> in the cpp file in the project
Any help to fix it?
There is an example on the Microsoft Docs for reference.
project->properties->configuration properties->C/C++->General->Addtional Include Directories->add the path of dll
project->properties->configuration properties->Linker->General->Addtional Library Directories->add the path of dll
project->properties->configuration properties->Linker->Input->Additional Dependencies
For the header file, you could click Project—>Configuration Properties—>C/C++—>General and add the folder path where the .h file is located in the Additional Include Directories.
I am trying to extract archived files in my project using Libarchive.
On a standalone code, i include libarchive's archive.h using:
#include <archive.h>
But I have seen on projects that header files are not included directly, they use:
#include <poppler/cpp/poppler-document.h>
Why is poppler-document.h not directly included?
So how are these directories specified?
If you're on visual studio you can go on Project Properties/"C/C++"/General and look at the additional include directories where you can add the directory of where those includes are. For including the .libs themselves you'll need to go in Linker/Additional Library Directories
I am trying to use OpenCV multi-target tracker, but cannot include the header files. I have built OpenCV with extra modules by providing the path to opencv_contrib-4.2.0\modules in OPENCV_EXTRA_MODULES_PATH in CMake GUI. However, I cannot include the trackers in the project:
code:
#include <opencv2/tracking.hpp>
error:
cannot open source file "opencv2/tracking.hpp"
code:
#include "samples_utility.hpp"
error:
Cannot open include file: 'samples_utility.hpp': No such file or directory
What should I do to add all the modules of OpenCV-contrib to the default OpenCV directory?
You don't have to add all the modules. Only the modules you need, and in this case the tracking module. You will need to add the corresponding folder to the include directory and the code should compile properly.(your folder might be in different location but the relative path should be the same)
{location_of_opencv_contrib}\modules\tracking\include
{location_of_opencv_contrib}\modules\tracking\samples
For visual studio, you can add the folder path above to Project Properties-> VC++ Directories -> Include Directories
If you are building using gcc, add -I option followed by the directory of the folder mentioned.
I have a source with VC++ 2017
I receive the error "Error C1083 Cannot open include file: 'QtCore/QMap': No such file or directory " when i try compile the project.
I download Qt libraries and add to Include project but the problem exist.
Which directory of Qt of i had to add to project to resolve error?
this is header of my code that generate error
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QList>
You need to update your project. Go to the project properties by right-clicking on it in Solution Explorer and then select Properties. Then:
In C/C++->General->Additional Include Directories you must set the Qt installation include path;
In Linker->General->Additional Library Directories you must add the path of .libs files of your qt installation;
In Linker->Input->Additional Dependencies you must put the name of .lib files that you need in order to build the project.
If it's a Qt project, you should also have the Qt plugin installed, in order to work properly with moc and other Qt features.
In alternative (that I suggest) you can create a CMake project and open in in Visual Studio.
I am using Visual Studio 2013 and have troubles using libusb dll. I have downloaded their source and compiled the dll version under release. New folder was created: D:\libusb-1.0.9\Win32\Release\dll which contains the .lib and .dll files. The next thing I did, was copied the .dll to my Visual studio projects folder, where the source files reside.
In Visual studio I then did: project->properties->linker->input->additional dependencies and pasted in the path to .lib file: D:\libusb-1.0.9\Win32\Release\dll\libusb-1.0.lib. Then I did project->properties->linker->general->additional library directories and pasted in the folder where the libusb header files are: D:\libusb-1.0.9\libusb.
Then I tried including the #include "libusb.h" but it says it cant find the file.
What else do I need to do, to make it work...?
EDIT:
These are the exact errors:
Cannot open include file: 'libusb.h': No such file or directory
IntelliSense: cannot open source file "libusb.h"
The problem is you did not add the folder containing the header file libusb.h to the include folders for your compiler. As a result the compiler can not find libusb.h since it is not in any of the folders the compiler searches.
In Visual Studio to add a folder to the include directories open the project properties for your target and add the folder to the C/C++->General->Additional Include Directories setting.