Boost Library

I'm not sure if this belongs in the beginners section or not but here goes.

I recently downloaded the Boost Library and discovered that I need to compile it before I can make use of it.

I was going to ask on the Code Blocks forums but they say specifically not to ask about installing libraries on their forums. I googled around a bit and I wasn't able to find any forums dedicated to the Boost Library so I figured I'd turn here for help.

I was following the steps on this Wiki guide here:

http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef

but when I get to the step where it says

bjam --toolset=gcc "--prefix=<installpath>" install


I get an error that says bjam not found. I'm assuming that's because the bjam file doesn't exist in the codeblocks folder.

I think this line here is also asking for that same bjam file

set PATH=<path>\boost-jam-3.1.18-1-ntx86;%PATH%




I see two .jam files in the folder that I unzipped the Boost Library into, I'm just uncertain which one to point this too.

I'm using version 1.55.0 if that helps anybody.

The two .jam files I see are

boost-build.jam

and

boostcpp.jam

The wiki said there was an autoinstaller that does these steps for me but I could not find it.

Any help would be appreciated and thank you for reading :)


edit.. I guess another question might be:

Is there an IDE that is easy to install Boost onto. I wouldn't mind learning something other than Codeblocks.
Last edited on
You only need to compile boost if you plan to use a couple of things, like the filesystem or regex libraries.


You should be following the instructions found here:
http://www.boost.org/doc/libs/release/more/getting_started/windows.html

Unfortunately, boost's setup is often times broken. You may need to fiddle with it a bit to get it working. Bjam itself is the most obnoxious beast. Since you are on Windows, you can download an already-compiled b2.exe (which is the current bjam executable).

Don't worry about screwing up. If you make a mistake, you can always just delete the boost directory, then unpack it from the zip again and try again.

Once you get boost built, then worry about telling C::B where to find it all and link it into your programs.


BTW, if you want to play with full internationalization, you should install ICU first. (It is easier to install than Boost, actually.)
http://site.icu-project.org/

If you get stuck, post back the exact steps you took and the exact error you got.


Also, be prepared to wait. It takes a long time to compile all the Boost binaries. Once you get it going you shouldn't see any troubles, so you can safely leave it until it is done.

Phew, well, good luck!
Thank you for bearing with me. A lot of this stuff isn't very intuitive to me as a beginner.

I followed that installation link you provided and was reading through the installation steps and it seems much easier to follow.


This link skips to section 5 (installation)
http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html#prepare-to-use-a-boost-library-binary


*Since I am using Windows 8 and a GCC compiler (on Codeblocks) I skipped step 5.1 (which was for visual c++) and went to step 5.2.

*Step 5.2 asks me to download an archive of files called boost.build

*I followed the link and downloaded the files. The next step is what I'm uncertain of. The documentation here is what i'm reading from:


http://www.boost.org/doc/libs/1_55_0/doc/html/bbv2/installation.html
Quoting from the link

1. Unpack the release. On the command line, go to the root of the unpacked tree.
2. Run either .\bootstrap.bat (on Windows), or ./bootstrap.sh (on other operating systems).
3. Run ./b2 install --prefix=PREFIX

where PREFIX is a directory where you want Boost.Build to be installed.

4. Optionally, add PREFIX/bin to your PATH environment variable.


I didn't see a bootstrap.bat file in the archive when I unpacked it. Am I suppose to copy the boost.build files into the root folder of the boost library I downloaded and use that bootstrap.bat?

I'll see if I can take a look at that other library some tomorrow. I'm mostly trying to learn different ways to parse data and everything I've read about is boost this or regex that so I figured I'd try to learn the boost library.

I'm going to try and get some sleep and mess with this tomorrow or the next day, got work tomorrow :(

No dire projects due or any class assignment, just doing this to learn.
Last edited on
STL's NUWEN MinGW build includes pre-built boost binaries
http://nuwen.net/mingw.html
Thanks for the link JLBorges. I was able to download that and follow the instructions all the way to the end. I went with option A and I got the proper message after I ran set_distros_path.bat

Now I just have to figure out how to link that into codeblocks. I still have some reading to do on that. I think I need to make a copy of the GCC compiler in the global compiler settings then manually link all the libraries in the boost folder.

----------------------------------------------------------------------------------------------------------------------------------------------

edit..

ok I got the NUWEN MinGW to work on codeblocks but it still won't compile any boost programs. Let me play with some more settings.

edit.. hmmmm... I think this might be what I need to learn here.

http://stackoverflow.com/questions/17184857/how-to-include-the-boost-library-into-a-c-program

I wonder if that means I have to include the header file path in the c++ code or add that after the linker settings in the IDE. Time to play with stuff some more.


----------------------------------------------------------------------------------------------------------------------------------------------

If anybody was interested in my log files when I tried to compile the Boost Library myself this is what it looks like.

*I unzipped a Boost 1.55.0 into an empty folder on my C:\ drive.

*I unzipped Boost.build into the same folder as Boost 1.55.0 and overwrote any duplicate files.

*I opened the command prompt, navigated to the boost_1_55_0 folder, then I typed bootstrap.bat gcc and hit enter.

*I got the error message
'gcc' is not recognized as an internal or external command, operable program, or batch file.



I noticed the log file had said "using msvc" if i just tried to run bootstrap.bat by itself so I tried with gcc.

Anyways here is the log file.

http://s19.postimg.org/hos40j6lv/image.jpg

Thanks again for the help. I feel like I'm slowly learning what I need to be able to make this work :)

----------------------------------------------------------------------------------------------------------------------------------------------

Another update. I think this information here might be relevant to getting boost to work.

http://stackoverflow.com/questions/7847454/how-do-i-install-the-boost-library-to-my-mingw-compiler




From your boost_X_XX_X directory, go to

.\tools\build\v2\engine

and type:

build.bat mingw

This will create a folder called bin.nt86_64 (for 64 bit OS...I don't know what it is on 32 bit systems). Add this directory to your PATH environment variable.

Return to your boost_X_XX_X directory and type:

bjam toolset=gcc



At least when I followed those instructions something different showed up. Picture below.

http://s19.postimg.org/ru4jvbtbl/image.jpg


I'm beginning to suspect my problem might be coming from me using mingw to begin with. I think mingw is oriented for linux? That might be why it's giving me issues on windows. I could probably try visual c++ if I can't figure this out in another day or two.

I would like to move away from Windows 8 because it annoys me but I don't know anything else and I'd feel better if I had another computer to mess around on so if I break the operating systems software or bios (now called UEFI i guess), I wouldn't have to worry about not being able to get stuff done while I reinstalled everything again.

Maybe after xmas I'll get another computer to mess around with and install linux. Then I'd feel better about having a backup in the highly probable event I destroy my bios (uefi), partition table, or operating system.

Anyways sorry for the wall of text. I think what I'm trying to accomplish here is beyond my skill set and the people who would have the skills to install boost on windows 8 probably don't use the operating system to begin with.

I'll just mark this topic as done to stop this thread from getting out of hand.

I'll see if I can try the boost IRC tomorrow before I give up and try a new compiler / IDE.
Last edited on
> Now I just have to figure out how to link that into codeblocks.

Menu: Settings => Compiler => Tab: Toolchain executables =>

1. Compilers Installation directory: C:\MinGW
(C:\MinGW assuming that you unpacked the NUWEN build into C:\.
Use the actual path to the directory into which it was installed)

2. Change C compiler: to gcc.exe, C++ compiler to: g++.exe, Linker for dynamic libs to: g++.exe
Thank you, I got all the linker settings working and I can compile regular c++ program that don't use the boost library.

However when I try to make a program that uses a boost header file I get errors that say no such file or directory.

I navigated through nuwen's mingw folder and in the folder include is a boost folder which has all the boost headers in it.

For some reason my IDE or compiler isn't picking up on that.

I have double checked that I am actually using nuwen's version of MinGW also.

------------------------------------------------------------------------------------------------------------------------------------

Ok, I think I got this working now. What I needed to learn was the concept of a global path variable.

I can now make boost programs. A happy ending I suppose.
Last edited on
Topic archived. No new replies allowed.