Boost logo

Boost :

From: Mat Marcus (mat-lists_at_[hidden])
Date: 2008-04-14 12:47:11

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, 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. My
user-config.jam contained, amongst other things, the following lines:

import toolset : using ;

using msvc : 9.0 : "C:\\Program Files\\Microsoft Visual Studio
9.0\\VC\\bin\\cl.exe" ;
using msvc : 8.0 : "C:\\Program Files\\Microsoft Visual Studio
8\\VC\\bin\\cl.exe" ;

using gcc : 4.2.0 : /opt/gcc-4.2.0/bin/g++.exe :
<cxxflags>-I/usr/local/w32api/include/w32api ;
using gcc : svn : /opt/conceptgcc-svn/bin/conceptg++.exe ; # concept gcc

With the above configuration, using boost 1.34.1, I was able build
executables whose jamfiles depended on boost threads with my
gcc-4.2.0. Presumably they were built upon the win32 thread
functionality, but I didn't check. When I upgraded boost 1.35.0 I lost
the ability to use the thread lib with my gcc-4.2.0, and I've been
trying to restore it. I tried both win32 and pthread variants from the
command line. Neither worked out of the box. I chose to drill down
into the win32 flavor first.

Following your advice, I went ahead and installed the mingw
w32api-3.11. Then I changed my user-config.jam's gcc-4.2.0 to point to
the mingw win32api include dir:

  using gcc : 4.2.0 : /opt/gcc-4.2.0/bin/g++.exe :
<cxxflags>-I/usr/local/w32api/include/w32api ;

When I invoke:

 bjam --without-mpi gcc-4.2.0 libs/thread/build//boost_thread -d+2

I see that one of the resulting compilation commands is:

 "/opt/gcc-4.2.0/bin/g++.exe" -ftemplate-depth-128
-I/usr/local/w32api/include/w32api -O0 -fno-inline -Wall -g -mthreads

But the errors remain:

libs\thread\src\win32\thread.cpp: In function 'void
libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a
member of 'boost::detail'
libs\thread\src\win32\thread.cpp:149: error: 'heap_delete' is not a
member of 'boost::detail'
libs\thread\src\win32\thread.cpp:159: error: 'heap_delete' is not a
member of 'boost::detail'


Sorry if I'm missing something obvious, but could you give me a little
more guidance on what specific things I might put in my
user-config.jam, or exactly what other actions I take in order to use
threads with my gcc-4.2.0 .


Boost list run by bdawes at, gregod at, cpdaniel at, john at