So i want to get Boost.serialization into my project but i just want that library from the boost package that you get. I built the boost thing so got i got access to the .lib files for the serialization library.
The ones i got are;
libboost_serialization-vc100-mt-1_55
libboost_serialization-vc100-mt-gd-1_55
libboost_wserialization-vc100-mt-1_55
libboost_wserialization-vc100-mt-gd-1_55
I took these and put them into a new folder and linked my VS project to these files to the additional lib directory.
I also took serialization folder from the boost package and put it in my include folder that is linked to my project.
When i now try to build my app i get these errors;
IntelliSense: cannot open source file "boost/config.hpp"
IntelliSense: cannot open source file "boost/operators.hpp"
IntelliSense: namespace "boost" has no member class "totally_ordered1"
How should i go about to fix these errors? Do i need to add all the .hpp files that the library wants or is there another way around this?
Thanks :)
You mentioned that you built boost and then moved some of the headers into your project. The latter is not advisable - leave the boost includes and libraries where you've installed them and built boost.
In Project ⇒ Properties ⇒ Configuration Properties, add
The toplevel boost directory to the Include Directories (eg., c:\boost)
The directory with the built boost libraries to the Library Directories (eg., c:\boost\lib)
If you still get IntelliSense errors after that add
The "$(ProjectDir)" to the Reference Directories
Related
I am trying to include the Boost Library in my OpenFrameworks project, in particular it is
When I add the boost root directory to the Additional Include Directories of a new project, I see the error LNK1104 cannot open file 'libboost_filesystem-vc141-mt-gd-x32-1_72.lib', although I don't even need the filesystem library.
However, when I added the boost root directory to the Additional Include Directories of a freshly create c++ console project, the error does not show, and I can make use of the library without problems.
Runtime Library is /MDd.
What might cause this problem? A broken build of boost?
One
Taken from the comments to the question. Although this is unusual it could be that a header in one of the dependencies of your project has the same name as a header in the filesystem library. And since you put boost first in the Additional Include Directories the boost header was included instead of a header from a different library. By default with Visual Studio boost automatically inserts link commands using a #pragma comment(lib, libname) so including this header will cause a link dependency.
A solution to try in this case is to move boost to the end of the Additional Include Directories so when the compiler searches for the header it will find the one from the previous dependency first.
I am a beginner on C++ and trying to learn about including libraries, and I haven't found documentation about it.
What are the ways of including libraries to a C++ project (Visual Studio). How do I implement them and which is the best way?
I was trying to include the SQLite library to a project. I tried to:
Include the header file in the include folder of the Visual Studio installation folder. It did appear in the External dependencies of my project, so I can do #include <sqlite3.h> without problems, but I don't know where I should put the implementation (a C file) and how to link it (is it in the linker>Input>Additional dependencies?).
Is it necessary that in order to include a library the file should be a .lib? Because I can't find the .lib for SQLite 3, do I have to include it in the lib folder of my Visual Studio installation?
Note: I am interested on the management of including a library in general. The SQLite 3 part is only because I took it as an example in order to learn how to add them.
A library is added in two steps
Adding headers path to the project
Adding .lib reference
In the first step, you must specify in the project where library headers are header. Usually, the path is specified in the project properties -> C++ -> Additional include directories, and them including files with relative paths.
In the second step you must specify in properties->linker the path where libraries (.lib) are located and the name of the library. With this Visual Studio is able to link the project properly.
go to project add existing item you must then select from the browse screen the .lib file you wish to add. and BINGO it is there!
best wishes
david
I am trying to open sdl2 in my project on Visual C++ 2012 but i keep getting this error:
error LNK1104: cannot open file 'SDL2.lib'
I added the additional libraries and include folder but no luck..
I added the link to the libraries through the linker but i get the same error..
what should i do?
I'm referencing VS 2010, but I've read before that some people have had errors when using the VC++ Directories in their project properties as opposed to the Linker->General->Additional Library Directories.
Unfortunately, there really isn't much more to do besides making sure the directories are linked properly. There really is only one answer to this question. It also may depend on the download of SDL you chose, are you donwloading the Development Library as opposed to the binary?
Watch this video https://www.youtube.com/watch?v=or1dAmUO8k0.
In summary, you want to add the path include folder here: (configuration properties> C/C++ > General> Additional Include Directories),
and add the path of the lib folder here: (configuration properties> Linker > General> Additional Library Directories)
and finally, link .lib file in: linker > input > Additional Dependencies.
It seems like you didn't add your library directory path in VC++ Directories/Library Directories.. You have to link your library directory path (Where you have save you libraries of SDL) in your program. After adding, it will definitely work
I would like to add for others experiencing this problem that its an easy mistake if you are using the Development Library to link to the lib folder. SDL needs you link to either the x86 or x64 folder in the lib folder.
If you run or compile your program before you make those required changes of SDL then you will get this error always.. so first add a c++ file then make those changes and then write something and try to run ..this time it will never give this error
It seems like VS can't find the lib files. There are two ways you can do this. One is to configure the appropriate directories in VS as TwinkleBearDev's article shows. Another is to put the libraries directly where VS would look for them, as my article shows. I don't know if the folders for VS2012 are the same though - might be slightly different.
I may be just missing something, but I'm trying to include a MongoDB C++ driver library build into my DLL project. I'm trying to follow this guide
I've tried including the folder in Configuration Properties->Linker->General->Additional Library Directories, and the .lib file in Linker->Input->Additional Dependencies. I've also added the /MT command-line option.
Now here comes my problem - how do I use the files? Do I just use #include "mongo/client/dbclient.h", because this doesn't seem to work (Cannot open source file). I can't find much of any helpful documentation on this subject.
Any ideas?
I have been using libcurl in a C++ project.
I have added the libcurl Include and Library directory's to the VC++ Directories and added the .lib file to the Linkers Input Additional Dependencies.
Everything works fine but when I check in my code (TFS) and somebody gets it on another machine they cannot build etc due to not having libcurl installed on their machine or installed in different paths etc.
How do I add all the necessary files to my C++ Solution so that anyone getting the project from source control can build and link without error.
Thanks
The solution I went with was too add the library file to a folder within my solution, then add
$(SolutionDir)libs\curllib.lib
To the Additional Dependencies within Linker->Input
You can not add the library to the solution. you should distribute the library along the source code. Place it in a subdirectory of the project so that it goes along the whole project source. Then configure the path in Additional Library Dependencies. That way the people should be able to link appropriately when building from source.