boost - 无法在Windows 7 64位上的Cygwin下编译Boost 1.50.0

标签 boost compiler-errors cygwin windows-7-x64

我试图在Windows 7 64位上的Cygwin下编译boost 1.50.0。

我运行命令:

./bootstrap.sh –prefix=boost/

然后我回来:
Building Boost.Build engine with toolset gcc...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details

这是日志:
###
### 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      $@

可能是什么问题呢?怎么解决呢?

最佳答案

该错误表明cygwin_conv_to_win32_path已过时。

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



历史:
Cygwin 1.x支持cygwin_conv_to_win32_path函数,而2.x版本不推荐使用。 2.x提供了替代API cygwin_conv_path
如何解决?
如下所示为这些不推荐使用的方法添加定义,它应该可以解决问题(我做了同样的事情,并且能够在cygwin上构建boost库)
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);
}

关于boost - 无法在Windows 7 64位上的Cygwin下编译Boost 1.50.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17428428/

相关文章:

cygwin 支持 ucontext.h 用户上下文切换

linux - rsync, 'uid/gid impossible to set' 案例导致 future 的硬链接(hard link)失败,如何解决?

android - 如何为 Android NDK 11 编译 Boost 1.61

c++ - boost (BGL): How do dis-obfuscate my errors?

arrays - VBA 数组和字符串错误

Cygwin top 命令 - 查看所有用户的进程

c++ - UDP 连接总是成功

c++ - 升级 Boost Serialization 与二进制归档 armv7 到 arm64 的兼容性

c++ - 错误: ISO C forbids comparison between pointer and integer

swift - 插入viewWillAppear函数后,在Swift中出现编译错误