提升错误提示:找不到“vswhere”

问题描述 投票:0回答:0

我是为我的项目部署 boost 的新手。下载解压后尝试构建boost引擎时,返回如下错误信息:

D:\Program Files\boost_1_81_0\boost_1_81_0>bootstrap.bat
Building Boost.Build engine
LOCALAPPDATA=C:\Users\Lenovo\AppData\Local
could not find "vswhere"
Call_If_Exists "..\bin\VCVARS32.BAT"
###
### Using 'msvc' toolset.
###

因为这个错误,执行b2的rest stages无法运行。根据与此相关的另一个存在的问题,需要预先安装 MinGC。但是,我发现我已经安装了MinGC并且正确设置了环境变量。 此外,在我意识到可以通过指定现有的编译器来执行引导命令后,我将我的命令修改为

bootstrap gcc

但它返回了另一个包含大量语法和变量错误的错误:

...
execnt.cpp:67:10: fatal error: versionhelpers.h: No such file or directory
   67 | #include <versionhelpers.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
jam.cpp: In function 'int guarded_main(int, char**)':
jam.cpp:185:22: error: 'environ' was not declared in this scope; did you mean 'union'?
  185 | # define use_environ environ
      |                      ^~~~~~~
jam.cpp:488:37: note: in expansion of macro 'use_environ'
  488 |         var_defines( root_module(), use_environ, 1 );
      |                                     ^~~~~~~~~~~
pathsys.cpp: In function 'char* executable_path(const char*)':
pathsys.cpp:381:54: error: 'strdup' was not declared in this scope; did you mean 'strcmp'?
  381 |     return ( !ret || ret == sizeof( buf ) ) ? NULL : strdup( buf );
      |                                                      ^~~~~~
      |                                                      strcmp
...

最后还是失败了:

D:\Program Files\boost_1_81_0\boost_1_81_0\tools\build\src\engine>dir *.exe
 Volume in drive D is Lenovo
 Volume Serial Number is 5806-0F8D

 Directory of D:\Program Files\boost_1_81_0\boost_1_81_0\tools\build\src\engine

File Not Found

Failed to build Boost.Build engine.

因为我是第一次安装和使用boost,所以非常希望大家能帮我解决这个问题或者给我一些修复的建议。非常感谢!

c++ boost
© www.soinside.com 2019 - 2024. All rights reserved.