From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2008-04-14 15:57:53
"Mat Marcus" <mat-lists_at_[hidden]> writes:
> 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?
> 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)
Because you're using msvc bjam to build using cygwin gcc. Apparently this
build option is broken.
> 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?
No. This has always been a requirement if you want to use pthreads on a plain
win32 (non-cygwin) compiler. It's just that the detection of cygwin is broken
in the jamfile.
Can you use a cygwin-built bjam?
-- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk