在 Windows 7 - bootstrap 错误上使用 cygwin 为 gcc 构建提升

build boost for gcc using cygwin on Windows 7 - bootstrap error

我下载了 boost 并正在执行此操作

admin@US01WKS03044 /cygdrive/c/Users/admin/Downloads/boost_1_49_0
$ ./bootstrap.bat gcc
Building Boost.Build engine
filent.c:35:21: fatal error: direct.h: No such file or directory
 # include <direct.h>
                     ^
compilation terminated.
jam.c: In function ‘main’:
jam.c:181:25: error: ‘environ’ undeclared (first use in this function)
     #define use_environ environ
                         ^
jam.c:417:22: note: in expansion of macro ‘use_environ’
         var_defines( use_environ, 1 );
                      ^
jam.c:181:25: note: each undeclared identifier is reported only once for each function it appears in
     #define use_environ environ
                         ^
jam.c:417:22: note: in expansion of macro ‘use_environ’
         var_defines( use_environ, 1 );
                      ^
jam.c: In function ‘executable_path’:
jam.c:628:18: warning: comparison between pointer and integer
     if (argv0[0] == "/")
                  ^
pathunix.c:276:19: fatal error: tchar.h: No such file or directory
 #include <tchar.h>
                   ^
compilation terminated.
builtins.c:39:0: warning: "WIFEXITED" redefined
 # define WIFEXITED(w)  (((w) & 0XFFFFFF00) == 0)
 ^
In file included from /usr/include/cygwin/stdlib.h:14:0,
                 from /usr/include/stdlib.h:25,
                 from jam.h:89,
                 from builtins.c:7:
/usr/include/cygwin/wait.h:34:0: note: this is the location of the previous definition
 #define WIFEXITED(w) ((__wait_status_to_int(w) & 0xff) == 0)
 ^
builtins.c:40:0: warning: "WEXITSTATUS" redefined
 # define WEXITSTATUS(w)(w)
 ^
In file included from /usr/include/cygwin/stdlib.h:14:0,
                 from /usr/include/stdlib.h:25,
                 from jam.h:89,
                 from builtins.c:7:
/usr/include/cygwin/wait.h:39:0: note: this is the location of the previous definition
 #define WEXITSTATUS(w) ((__wait_status_to_int(w) >> 8) & 0xff)
 ^

Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.

You can try to obtain a prebuilt binary from

   http://sf.net/project/showfiles.php?group_id=7586&package_id=72941

Also, you can file an issue at http://svn.boost.org
Please attach bootstrap.log in that case.

关于我为什么会收到此错误的任何建议?

文件 bootstrap.bat 用于从 Windows 命令提示符构建 Boost,以便创建本机 Windows 版本的 Boost。如果你想从 Cygwin shell 构建一个 Cygwin 版本的 Boost,你应该遵循 instructions for building Boost on Unix-type systems.

或者正如 Boost Getting Started on Windows 页面顶部的消息所说:

A note to Cygwin and MinGW users

If you plan to use your tools from the Windows command prompt, you're in the right place. If you plan to build from the Cygwin bash shell, you're actually running on a POSIX platform and should follow the instructions for getting started on Unix variants.