Boost logo

Boost :

From: Mat Marcus (mat-lists_at_[hidden])
Date: 2008-04-14 13:34:37


On Mon, Apr 14, 2008 at 10:25 AM, Anthony Williams
<anthony_w.geo_at_[hidden]> wrote:
> "Mat Marcus" <mat-lists_at_[hidden]> writes:
>
> > On Mon, Apr 14, 2008 at 1:20 AM, Anthony Williams
> > <anthony_w.geo_at_[hidden]> wrote:
> >> "Mat Marcus" <mat-lists_at_[hidden]> writes:
> >>
> >> > It seems that I am unable to build/use boost threads when compiling
> >> > with gcc-4.2.0 on windows. I get errors:
> >> >
> >> > libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a
> >> > member of 'boost::detail'
> >> >
> >> > and other (see below). Can someone advise me as to how I can get
> >> > boost_thread to build under gcc-4.2.0/32-bit XP machine wth boost
> >> > 1.35.0.
> >>
> >> This surprises me: building using your bjam command line with gcc-4.2.1 on
> >> 32-bit Windows XP compiles file.
> >>
> >> Have you got the latest w32api headers on your include path? I use w32api-3.10
> >> from www.mingw.org, but earlier versions should work too.
> >>
> >> Anthony
> >
> > Thanks for the suggestion. I naively followed it, but things haven't
> > improved yet.
> >
> > Let me tell you a little bit more about my configuration. I use a
> > version of bjam built with mscv, since my primary builds on this
> > machine use the MS compiler. But I sometimes need to build with
> > gcc-4.x. I usually run bjam from the cygwin shell, though sometimes I
> > use cmd. I configured and compiled my own gcc-4.2.0 under cygwin. I
> > had not installed the mingw win32 api headers in the past.
>
> OK, stop right there. I naively assumed that you would be using the mingw port
> of gcc like I am. The cygwin port of gcc should use the pthread API by
> default. You do not need the w32api headers to build boost thread with cygwin
> and the pthread API.
>
> I guess the build problems you're having are because the pthread headers are
> being chosen, but the build system is choosing the win32 source files.
>
> I don't have cygwin on this machine, so could you try building with
> "threadapi=pthread" on the bjam command line?
>
>
> Anthony

I'm pasting the result below. A couple of questions:

1) Why doesn't the build system choose the threadapi=pthread by
default in my configuration? (The default seems to be win32)
2) Did 1.35.0 add the requirement over 1.34.1 that I need to download,
build, and update my user-config.jam to point to a posix threads
library before using boost threads?

$ bjam -j2 debug gcc-4.2.0 --without-mpi --without-python
threadapi=pthread libs/thread/build//boost_thread
warning: Graph library does not contain optional GraphML reader.
note: to enable GraphML support, set EXPAT_INCLUDE and EXPAT_LIBPATH to the
note: directories containing the Expat headers and libraries, respectively.
Building Boost.Regex with the optional Unicode/ICU support disabled.
Please refer to the Boost.Regex documentation for more information
(don't panic: this is a strictly optional feature).
************************************************************
Trying to build Boost.Thread with pthread support.
If you need pthread you should specify the paths.
You can specify them in site-config.jam, user-config.jam
or in the environment.
For example:
PTW32_INCLUDE=C:\Program Files\ptw32\Pre-built2\include
PTW32_LIB=C:\Program Files\ptw32\Pre-built2\lib
************************************************************
Skipping build of: libs/thread/build/boost_thread <build>no in
common properties
...found 1 target...


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk