Failed to build boost - c++

I have been able to compile boost on Windows Vista using the following commands:
bootstrap.bat
bjam.exe --with-filesystem --with-thread --toolset=msvc
However, when I issue the same command on Windows 7, I get this:
'failed to write output file 'bin.v2\libs\thread\build\msvc-8.0\release\link-static\threading-multi\libboost_thread-vc80-mt-1_48.lib.rsp'!'
What am I doing wrong?

I had this and the problem turned out to be that boost seems to have some problems with long path names. Moved the directories up a couple of levels and it all started working. But had me pulling my hair out for a while

You can use bjam.exe --abbreviate-paths
Found here: http://lists.boost.org/boost-build/2007/01/16028.php
I had similar problem and this switch helped me a lot (although it is not documented).

Related

Building boost 1.61.0 with MinGW 5.3.0

Has anyone had any success in building boost 1.61.0 for Mingw? I've Googled for this, and all the suggestions that apparently worked well in the past result in errors now. It doesn't help that boost's "Getting Started on Windows" page is a poorly structured, incomplete mess that seems to have been getting only the most rudimentary updates for a while now (there are even a couple of dead links in there). I somehow managed to build boost 1.58 for an older MinGW version, but that was quite a while ago and I foolishly neglected to write down the individual steps required to make it work. :-\
Ok, I did get it to work, but apparently the bug in the boost build system discussed here is still in boost 1.61. I worked around that by skipping the libraries that run into this problem and only building the ones that I need. Here's what worked for me.
Download and unzip boost_1_61_0.7z to D:\Dev\Libs\boost\boost_1_61_0
Extend PATH variable to contain bin folder that contains MinGW g++.exe, and make sure no other g++.exe instances appear in PATH before this one (that actually tripped me up the first time, because several programs I've installed come packaged with their own g++ version).
Open cmd window.
Run cd D:\Dev\Libs\boost\boost_1_61_0\tools\build
Run .\bootstrap.bat (if you skip this, step 6 will fail with 'Unknown toolset: mingw' ... WTF???)
Run .\bootstrap.bat mingw
Run .\b2.exe install toolset=gcc --prefix=D:\Dev\Libs\boost\boost_1_61_0\b2_for_mingw
Run cd D:\Dev\Libs\boost\boost_1_61_0
Run set PATH=%PATH%;D:\Dev\Libs\boost\boost_1_61_0\b2_for_mingw\bin
Run b2 toolset=gcc --build-type=complete stage --with-filesystem --with-system (since I only need the filesystem and system libraries).
EDIT: For boost 1.64, step 5 must be skipped entirely, and in step 6 gcc needs to be specified instead of mingw, as pointed out in the comments by user fest.
The answer from #antred worked pretty well. Only changes I needed to do to compile boost 1.67.0 is follows:
Instead of step 5 and 6 run .\bootstrap.bat gcc
At step 10 run b2 --build-dir="C:\Program Files\boost_1_67_0\build" --prefix="C:\Program Files\boost" toolset=gcc install

Trouble installing Boost C++

Right now, I am trying to install boost on my computer, a Mac running Mavericks. I have downloaded and decompressed boost into the directory
$HOME/local/src/
After decompressing, I moved it to a new directory inside the boost source directory:
tools/build/v2
I then executed
./boostrap.sh --with-toolset=gcc
This all went fine. The next step is where the problems start: in the src file, I executed the following command:
tools/build/v2/boost_1_57_0/b2 install --prefix=PREFIX --toolset=gcc --with-program_options --with-filesystem
It then returned the following error:
Unable to load Boost.Build: could not find "boost-build.jam"
---------------------------------------------------------------
BOOST_ROOT must be set, either in the environment, or
on the command-line with -sBOOST_ROOT=..., to the root
of the boost installation.
It says it can't find boost-build.jam, but I open up the folder in Finder and I see boost-build.jam right there in my boost_1_57_0 folder. What can I do to execute this command? Am I doing something wrong? If it runs correctly, I should have a PREFIX/include directory with header files for boost. What can I do to get this? Here is a link to the site for Boost if that will help:
http://www.boost.org
Also, I have already found this page on how to install Boost:
How do you install Boost on MacOS?
Will the method this user describes give the same result that the code above would if it was functioning properly? Thank you in advance.
Install brew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then do:
brew install boost-build
After that you will have the bjam executable in /usr/local/bin/bjam.
Thank you to elyase for his response. I have also found a way to solve the problem posted above that doesn't use brew. I was making the mistake of making a new tools/build/v2 folder in my src folder--however, I was supposed to cd into the tools/build folder already in the downloaded boost folder. Also, in the newer versions of boost, there is no v2 folder--so just use
tools/build/b2 install --prefix=PREFIX --toolset=gcc --with-program_options --with-filesystem
Hopefully this will help people who are new to Mac (like me) who are having similar problems.

wxwidget with MinGW [compiliing/linking to wxmsw26ud_core ]

Using:
Compiler: 4.81 GCC (MINGW)
OS: windows 7
wxwidgets: version (2.8) & (2.6) [out of frustration tried both versions]
installation instruction followed: wxwidget [wx/doc/install.txt]
Having problems installing wxwidgets; I have tried both the MSYS method and using the cmd.exe but cannot seem to get it working
So tried a fresh install recently and I get the following error:
ld.exe: cannot find -lwxmsw26ud_core
So since it is a linking error; I checked C:\wxWidgets\lib\gcc_lib\ and the wxmsw26ud_core is missing. So I am guessing there is something wrong in the build process.
For reference, I am using the following mingw32-make -f makefile.gcc BUILD=debug UNICODE=1 SHARED=0 MONOLITHIC=0 under C:\wxWidgets\build\msw
Any suggestion what would make it work?
Thanks in advance
First of all, wxWidgets 2.6 is an incredibly old version, you won't find any support for it any longer. This being said, even it should have been built and 2.8 definitely should as well. But clearly it didn't, so you must have got an error after running make. Unfortunately you don't tell us what this error was, so I don't know how to help you.
My own recommendation is to get wxWidgets 2.9.5 and use configure and make under Cygwin but using mingw32-make should work too.

How do I install the boost library to my MinGW compiler?

I'm compiling from the command line using g++ on a Windows MinGW installation. How do I get boost...conceptually or if it is easy...what do I need to download and install?
I know this is an old question but for future reference for anybody coming to this page try this website,
http://nuwen.net/mingw.html
They have done all the hard work so you don't have to. The most recent distribution on this page has boost 1_52_0 (which is the latest version on the boost website as I'm writing this) including the separately compiled libraries (e.g. boost thread, boost regex etc) which I beleive you're asking for
I spent hours searching for a good solution for Boost 1.54. If you already have MinGW and you're just looking for instructions on compiling the binary boost libraries, try this:
From your boost_X_XX_X directory, go to
.\tools\build\src\engine
and type:
build.bat mingw
This will create a folder called bin.ntx86 or bin.ntx86_64 depending on your architecture. Add this directory to your PATH environment variable.
Return to your boost_X_XX_X directory and type:
bjam toolset=gcc
This worked for me on my system. I'd be interested to know if other systems have trouble with these instructions.
However there would have been a simpler, yet identical way; your steps until the bjam call are automatically done by bootstrap.bat:
C:\boost_1_52_0> bootstrap.bat mingw
Building Boost.Build engine
...
C:\boost_1_52_0> b2 toolset=gcc
Reference: https://stackoverflow.com/a/13257930/2171309
Thanx to Neal Kruis. This worked for me. I have Qt 5.4 with mingw 4.9 installed. I downloaded boost 1.59. Go to "...\boost_1_59_0\tools\build\src\engine\" folder
set PATH=%PATH%;c:\Qt\Qt5.4.0\Tools\mingw491_32\bin
build.bat mingw
go to "...\boost_1_59_0\" folder, change boost path accordingly
set PATH=%PATH%;c:\boost_1_59_0\tools\build\src\engine\bin.ntx86
bjam toolset=gcc

Using Boost::asio in Winx64: I'm stuck, need to figure out how to build libboost_system_xxxx.lib for x64

Unlike this question:
Linker Error while building application using Boost Asio in Visual Studio C++ 2008 Express
I need an x64 build of the lib files... I'm not even sure how to get started. I'm reading here:
http://www.boost.org/doc/libs/1_39_0/more/getting_started/windows.html
Or, more generally, how do I build boost for x64?
I'm not on Windows, but I guess adding address-model=64 to the bjam invocation should do the trick.
Please note that this is explained in the official documentation, right here
Here is the command line I ended up using:
C:\Program Files (x86)\boost\boost_1_38>bjam --build-dir=c:\boost --build-type=complete --toolset=msvc-9.0 address-model=64 architecture=x86 --with-system
I was in the process of figuring this out myself recently, when attempting to port a 32-bits program that made use of the 32-bits binaries provided by BoostPro. I couldn't download x64 binaries from BoostPro for free; they only provide free 32-bits libraries. But then I found that there were free binaries available from this site:
http://boost.teeks99.com/
I realize this may not answer your question if you want some customized build, but it could save you a lot of time if a regular build is fine. Unpacked, it's huge (7Gb) but it seems to be complete and working.