Search code examples
boostcompiler-errorscygwinwindows-7-x64

Can't compile boost 1.50.0 under Cygwin on Windows 7 64-bit


I am trying to compile boost 1.50.0 under Cygwin on Windows 7 64-bit.

I run the command:

./bootstrap.sh –prefix=boost/

and I get back:

Building Boost.Build engine with toolset gcc...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details

Here is the log:

###
### Using 'gcc' toolset.
###
rm -rf bootstrap
mkdir bootstrap
gcc -o bootstrap/jam0 command.c compile.c constants.c debug.c function.c glob.c         hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathunix.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c
function.c: In function ‘var_edit_shift’:
function.c:653:13: warning: ‘cygwin_conv_to_win32_path’ is deprecated (declared at /usr/include/sys/cygwin.h:36) [-Wdeprecated-declarations]
./bootstrap/jam0 -f build.jam --toolset=gcc --toolset-root= clean
./build.sh: line 13:  8144 Segmentation fault      $@

What could be the problem? How to solve it?


Solution

  • The error makes it evident that the cygwin_conv_to_win32_path is deprecated.

    function.c:653:13: warning: ‘cygwin_conv_to_win32_path’ is deprecated (declared at /usr/include/sys/cygwin.h:36) [-Wdeprecated-declarations]

    History: The function cygwin_conv_to_win32_path was supported in Cygwin 1.x and was deprecated in 2.x versions. The 2.x provides the replacement API cygwin_conv_path

    How to fix it? Add definition for these deprecated methods as below, and it should resolve the issue( I did the same and was able to build boost library on cygwin)

    void cygwin_conv_to_win32_path(const char *posix, char * win32)
    {
        /* Get the size */
        ssize_t size = cygwin_conv_path( CCP_POSIX_TO_WIN_A, posix, NULL, 0);
        cygwin_conv_path( CCP_POSIX_TO_WIN_A, posix, win32, size);
    }
    
    void cygwin_conv_to_posix_path (const char *win32, char * posix)
    {
        /* Get the size */
        ssize_t size = cygwin_conv_path( CCP_WIN_A_TO_POSIX, win32, NULL, 0);
        cygwin_conv_path(  CCP_WIN_A_TO_POSIX , win32, posix, size);
    }