For my next assignment I require threading in C++ and have read that the boost library for threading works fairly well. I've never added a custom library to Netbeans and was hoping someone could provide me some steps to follow in order to allow me to #include it and use it in my class.
So far I've downloaded the following: Boost library from here: http://sourceforge.net/projects/boost/files/boost/1.52.0/ (Not sure if it matters where I extract this too.. I'm assuming I need to set NetBeans to point at it somewhere within the properties of my package?)
NetBeans 7.2.1 C/C++ Installer for Windows from here: http://netbeans.org/downloads/start.html?platform=windows&lang=en&option=cpp
Compiling with: MinGW
Any help would be great. Thanks!
Building the special stage target places Boost library binaries in the stage/lib/ subdirectory of the Boost tree. To use a different directory pass the --stagedir=directory option to b2. b2 is case-sensitive; it is important that all the parts shown in bold type above be entirely lower-case.
Go to Project properties → C/C++ → General → Additional Include Directories, and add a path to the boost library root (in my case C:\Program Files (x86)\Boost_1_53 ). Include a . hpp file in your sources, like #include <boost/lexical_cast/lexical_cast_old. hpp>
Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains 164 individual libraries (as of version 1.76). Boost.
Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking. The only Boost libraries that must be built separately are: Boost.
Linking library:
Project -> properties -> Linker ->Libraries -> Add option -> Other -> -l%libname%
Path to libraries:
Project -> properties -> Linker -> Additional Library Directories
Includes:
Project -> properties -> C++ Compiler -> Include Directories -> %paths_to_boost%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With