6

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!

user1809606
  • 63
  • 1
  • 1
  • 3

1 Answers1

7

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%

Denis Ermolin
  • 5,530
  • 6
  • 27
  • 44
  • The 'Path to libraries' and 'Includes' steps seemed to have worked but after I link the library it won't compile for me. Returns with: c:\minGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -l%thread% collect2: ld returned 1 exit status – user1809606 Nov 08 '12 at 17:07
  • try also add same library path to runtime library path – Denis Ermolin Nov 08 '12 at 17:23