Boost logo

Boost :

Subject: Re: [boost] [thread] fails to build on Cygwin with weird errors
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-01-15 07:45:29


On 15 Jan 2015 at 5:22, Peter Dimov wrote:

> Vicente,
>
> I'm trying to get the pool tests up and running (they fail across the board,
> at least on develop), and one of them requires Thread, which fails to build
> under g++/Cygwin.

It's working with mingw32 and mingw64:

https://ci.nedprod.com/view/Boost%20Thread-Expected-Permit/job/Boost.T
hread%20Build/

> The errors are of the kind
>
> ..\..\..\libs\thread\src\win32\thread.cpp: In member function 'bool
> boost::thread::start_thread_noexcept()':
> ..\..\..\libs\thread\src\win32\thread.cpp:337:127: error: 'struct
> boost::detail::thread_data_base' has no member named 'id'
> uintptr_t const
> new_thread=_beginthreadex(0,0,&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id);
>
> which leads me to think that, on Cygwin, you're using the POSIX header with
> the Win32 source file.

I believe Cygwin wants you to use a pthread API, so this is expected.
Its point is to emulate POSIX on Windows. Often the best way of
building for Cygwin is to #undef WIN32 entirely and let the code
think it's building for Linux.

I'm not even sure if Cygwin is supported by Boost.Thread. If it was,
it certainly isn't regularly tested.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ 
http://ie.linkedin.com/in/nialldouglas/



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