简体   繁体   中英

Eclipse and cygwin - Error: Program “sh” not found in PATH

I am running the following code:

#include <iostream> 
using namespace std;
int main() {
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    return
}

I get the following error message:

Invoking autoreconf in build directory: C:/Users/madle/eclipse-workspace/hjbhjbjh/

Configuration failed with error (sh -c "autoreconf -i" Cannot run program "sh": Launching failed

Error: Program "sh" not found in PATH PATH=[C:/Program Files/Java/jre1.8.0_181/bin/server;C:/Program Files/Java/jre1.8.0_181/bin;C:/Program Files/Java/jre1.8.0_181/lib/amd64;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\Users\\madle\\AppData\\Local\\Microsoft\\WindowsApps;;C:\\eclipse;] )

How can I prevent this error from occurring?

Make sure you had choiced the right "Perspective".

You need to select C++, after that hit "Build Project".

在此处输入图片说明

Also make sure you had choice toolchain that you had install in your computer. In you case need to point out cygwin: 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM