OpenCV for Android:在 PATH 中找不到错误程序"sh"

OpenCV for Android: Error Program "sh" not found in PATH

本文关键字:找不到 错误 程序 sh PATH for Android OpenCV      更新时间:2023-10-16

我尝试使用这里的官方教程在Eclipse中构建OpenCV4Android SDK。我遵循了所有这些说明,在尝试从OpenCV4Android SDK构建那些OpenCV库项目时,我得到了以下错误:

Invoking autoreconf in build directory: C:/Android-64/Opencv4Android/sdk/java/

Configuration failed with error
(sh -c "autoreconf -i" 
Cannot run program "sh": Launching failed
Error: Program "sh" not found in PATH
PATH=[C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;c:Program Files (x86)Microsoft SQL Server100ToolsBinn;c:Program FilesMicrosoft SQL Server100ToolsBinn;c:Program FilesMicrosoft SQL Server100DTSBinn;C:Program FilesTortoiseSVNbin;C:Program FilesMicrosoftWeb Platform Installer;C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv1.0;C:Program Files (x86)Windows Kits8.0Windows Performance Toolkit;C:Program FilesMicrosoft SQL Server110ToolsBinn;C:Program Files (x86)MATLABR2013abin;C:Program Files (x86)IDM Computer SolutionsUltraEdit]
)

这是我第一次尝试在Eclipse中构建C++代码(以前我使用VS),所以我怀疑这可能是在Eclipse中编译C++代码的问题。经过一些互联网搜索,我在Eclipse中打开了Properties->C/C++Build->Settings->Binary Parsers中的PE Windows Parser,但错误仍然存在。我该如何解决这个问题?提前谢谢。

尝试安装CYGWIN,并在Windows环境变量的path中提供CYGWIN的bin目录的路径(在声明Windows Toolkit之前)。也许Windows工具包不适合您。

根据此线程,您应该尝试创建一个新项目Executable project,然后选择要使用的工具链。