Search code examples
c++boostcygwin

Compile error in boost log with cygwin win32_api.hpp


I am trying to utilise boost's logging library, however am struggling to compile it. All other boost libraries are compiling correctly.

I am bootstrapping using the following command:

./bootstrap.sh --with-python-root=/cygdrive/c/Python27/

Then compiling via:

./b2 -j5 link=static

The short summary of the output is:

gcc.compile.c++ bin.v2/libs/log/build/gcc-5.4.0/release/link-static/threading-multi/posix/ipc_reliable_message_queue.o
In file included from ./boost/interprocess/errors.hpp:41:0,
from ./boost/interprocess/exceptions.hpp:24,
from libs/log/src/posix/ipc_reliable_message_queue.cpp:49:
./boost/interprocess/detail/win32_api.hpp: In function ‘int boost::interprocess::winapi::release_semaphore(void*, long int, long int*)’:
./boost/interprocess/detail/win32_api.hpp:1352:61: error: cannot convert ‘long int*’ to ‘LPLONG {aka int*}’ for argument ‘3’ to ‘WINBOOL ReleaseSemaphore(HANDLE, LONG, LPLONG)’
{ return ReleaseSemaphore(handle, release_count, prev_count); }
^

The full output is here.

NB: I just used the first text host google turned up, if there's a recommended one I can re-upload.

EDIT: I had missed my Boost version:

I am using boost.1.64.0, which is the latest version on the website.


Solution

  • Apparently, Boost.Interprocess does not support Cygwin. You can disable the relevant functionality of Boost.Log by adding define=BOOST_LOG_WITHOUT_IPC to your b2 command line.