ProjectHax

ProjectHax General Programming

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 05-19-2011
WeeMan WeeMan is offline
Administrator
 
Join Date: Apr 2011
Location: United States
Posts: 12,358
Default Setting up boost C++ lib

1. Download the latest version of boost from www.boost.org. The current version at the time of this writing is 1.51.0.

2. Extract the contents of the zip.

3. Execute 'bootstrap.bat'

4. Open "Visual Studio Command Prompt 20xx"


5. cd over to the main boost folder

6. Execute the command:
Code:
b2 --toolset=msvc-10.0 --build-type=complete stage
However, if you have multiple cores you can add this to the end of the command '-jN' where 'N' is the number of threads.

6a. (optional -- use a separate boost folder) For x86_x64:
Code:
b2 --toolset=msvc-10.0 --with-serialization --build-type=complete architecture=x86 address-model=64
6b. (optional) Building with zlib support
Code:
-sZLIB_SOURCE="C:\zlib-1.2.8"
6c. (optional) Building with bzip2 support
Code:
-sBZIP2_SOURCE="C:\bzip2-1.0.6"
7. Create a new 'Win32 Console Application' project.

8. Right click on the project name (left side) and choose Properties.

9. Click VC++ Directories.

10. Edit the 'Include Directories' to have the main boost folder. So if boost is located in 'C:\boost_1_51_0' you would include that directory.

11. Edit the 'Library Directories' to have the folder 'stage\lib'. This is located within the boost folder.

12. You may now use the boost C++ libraries!

Build with XP support for VS2013:
Code:
b2 --toolset=msvc-12.0_xp define=BOOST_USE_WINAPI_VERSION=0x0501 --build-type=complete stage
https://svn.boost.org/trac/boost/ticket/9196
__________________
New forum coming soon!
https://forum.projecthax.com/t/welcome/37
  #2  
Old 05-26-2011
WeeMan WeeMan is offline
Administrator
 
Join Date: Apr 2011
Location: United States
Posts: 12,358
Default

Building boost on Debian/Ubuntu.

1. Download boost
2. Extract

Run the rest as root
3. apt-get install build-essential libbz2-dev libghc6-zlib-dev
4. ./bootstrap.sh
5. ./bjam --prefix=/usr/ install
6. ldconfig

If you have low RAM:
5. ./bjam --prefix=/usr/ install --without-python --without-signals --without-test --without-wave --without-chrono --without-graph --without-graph_parallel --without-math --without-mpi install


There might be an issue with boost versions above 1.48.0 and SSH pub key authentication. I had a weird problem where my keys weren't valid after compiling boost 1.50.
__________________
New forum coming soon!
https://forum.projecthax.com/t/welcome/37
  #3  
Old 07-30-2011
WeeMan WeeMan is offline
Administrator
 
Join Date: Apr 2011
Location: United States
Posts: 12,358
Default

Setting up CodeBlocks with boost support.

1. Download the latest version of CodeBlocks for your distro
http://www.codeblocks.org/downloads/26

2. Extract the contents

3. Start a root terminal and cd over to that directory

4. dpkg -i *.deb
Everything should install correctly

5. Run CodeBlocks from the Applications -> Programming menu


6. Set the default compiler to GCC

7. File -> New -> Project


8. Console Application -> Go


9. Next -> (Make sure it says C++) Next

10. Choose the project path and a project title -> Next -> Finish

11. On the left side right click on your project's name and choose properties


12. Choose project's build options


13. Choose the linker tab and click add


14. Assuming you followed the steps in the previous post you should be able to just add the following:
/usr/lib/libboost_system.so
/usr/lib/libboost_thread.so
/usr/lib/libboost_program_options.so

15. OK -> OK

16. Test it.

#include <boost/shared_ptr.hpp>
boost::shared_ptr<int> test(new int(1234));
printf("%d\n", *test);
__________________
New forum coming soon!
https://forum.projecthax.com/t/welcome/37
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Qt and Boost bot90210 Programming 1 09-08-2013 05:17 AM
Setting up Qt5 Nike4Eva Programming 10 05-20-2013 04:53 PM
Setting up Qt4 WeeMan Programming 3 01-03-2013 03:35 AM
C++ Boost List IP Addresses WeeMan Programming 0 08-17-2011 01:57 AM


All times are GMT. The time now is 08:24 PM.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.

Google+ Facebook Twitter