MinGW sh.exe must NOT be in your path

后端 未结 5 1244
长发绾君心
长发绾君心 2021-01-31 02:46

Currently trying to setup my C development environment on windows with MinGW and it looks like CMAKE is giving me the following error:

sh.exe was found in your P         


        
相关标签:
5条回答
  • 2021-01-31 02:53

    Just add

    set(DCMAKE_SH="CMAKE_SH-NOTFOUND")

    to your

    CMakeLists.txt file

    0 讨论(0)
  • 2021-01-31 02:57

    I like @Elia's answer, but if you are using CLion, it uses the CodeBlocks - MinGW Makefiles CMake generator which doesn't have the sh.exe checking problem. Add this to your CMake line:

    -G "CodeBlocks - MinGW Makefiles"
    
    0 讨论(0)
  • 2021-01-31 03:02

    For me, this simple parameter passed to cmake has worked -DCMAKE_SH="CMAKE_SH-NOTFOUND".

    0 讨论(0)
  • 2021-01-31 03:13

    Check you really do not have sh.exe in your PATH by opening a Windows Command Line and typing where sh.exe. If you have this file in your path, the command will return its path (then you should remove it from your PATH) else if windows return it was not found, try to clean up the folder CMakeFiles and a file name CMakeCache.txt somewhere inside your project folder.

    0 讨论(0)
  • 2021-01-31 03:17

    It's the problem of your git's path.
    I assume you are using the Clion, just check if you have added %gitpath%\binto your path, that's where the problem is. You should use %gitpath%\cmdinstead, typically for me it's D:\Git\cmd.Since the former one includes sh.exe in your path which results in the error.

    0 讨论(0)
提交回复
热议问题