Makefile CLion无法运行程序“;制造;系统找不到指定的文件
在CLion中打开makefile项目时,我收到错误消息:Makefile CLion无法运行程序“;制造;系统找不到指定的文件,makefile,clion,jetbrains-ide,mingw-w64,msys2,Makefile,Clion,Jetbrains Ide,Mingw W64,Msys2,在CLion中打开makefile项目时,我收到错误消息: Cannot run program "make" (in directory "D:\Werkstudent\XWF\XT_Einzelauswertung"): CreateProcess error=2, The system cannot find the file specified: CreateProcess error=2, The system cannot find the f
Cannot run program "make" (in directory "D:\Werkstudent\XWF\XT_Einzelauswertung"): CreateProcess error=2, The system cannot find the file specified: CreateProcess error=2, The system cannot find the file specified
Make execution failed with exit code = 127
- 我使用的是mingw64,安装在Windows上的msys2
已安装mingw-w64-x86_64-toolchain
- 在
中,我添加了MinGW和EnvironmentBuild,Execution,Deployment->toolschains
。使C编译器和C++编译器都正确检测。C:\msys64\mingw64
- 在
中,我将使可执行文件的路径设置为Build,Execution,Deployment->Build Tools->Make
C:\msys64\mingw64\bin\mingw32 Make.exe
2020-11-23 10:01:57,997 [ 244797] INFO - System.util.ExternalSystemUtil - External project [D:/Werkstudent/XWF/XT_Einzelauswertung] resolution task started
2020-11-23 10:01:57,997 [ 244797] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile analysis started at: 10:01:57 id: analysis:aa0e0ae1-8957-4100-b93e-e389cbdb8646
2020-11-23 10:01:59,285 [ 246085] INFO - om.jetbrains.cidr.cpp.makefile - MakefileResolverState: Starting make: make clean
2020-11-23 10:01:59,293 [ 246093] DEBUG - om.jetbrains.cidr.cpp.makefile - Channel closed coroutine name = StandaloneCoroutine{Completed}@60fcd138
2020-11-23 10:01:59,295 [ 246095] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile constructor message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.ConstructorAnalysisError(Make execution failed with exit code = 127)
2020-11-23 10:01:59,305 [ 246105] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile analyzer message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.MakeExecutionError(Make execution failed with exit code = 127)
2020-11-23 10:01:59,315 [ 246115] INFO - om.jetbrains.cidr.cpp.makefile - MakefileResolverState: Starting make: make --just-print --print-directory --keep-going all
2020-11-23 10:01:59,330 [ 246130] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile constructor message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.CriticalConstructorAnalysisError(Cannot run program "make" (in directory "D:\Werkstudent\XWF\XT_Einzelauswertung"): CreateProcess error=2, The system cannot find the file specified)
2020-11-23 10:01:59,331 [ 246131] DEBUG - om.jetbrains.cidr.cpp.makefile - Channel closed coroutine name = StandaloneCoroutine{Completed}@742f7782
2020-11-23 10:01:59,330 [ 246130] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile analyzer message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.CriticalAnalysisFailure(Cannot run program "make" (in directory "D:\Werkstudent\XWF\XT_Einzelauswertung"): CreateProcess error=2, The system cannot find the file specified)
2020-11-23 10:01:59,331 [ 246131] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile analyzer message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.MakeExecutionError(Make execution failed with exit code = 127)
2020-11-23 10:01:59,331 [ 246131] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile constructor message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.ConstructorAnalysisError(Make execution failed with exit code = 127)
2020-11-23 10:01:59,361 [ 246161] INFO - om.jetbrains.cidr.cpp.makefile - make exited with code 127
2020-11-23 10:01:59,361 [ 246161] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile constructor message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.ConstructorAnalysisError(Make execution failed with exit code = 127)
2020-11-23 10:01:59,361 [ 246161] DEBUG - om.jetbrains.cidr.cpp.makefile - Channel closed coroutine name = StandaloneCoroutine{Completed}@63439922
2020-11-23 10:01:59,371 [ 246171] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile analyzer message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.MakeExecutionError(Make execution failed with exit code = 127)
2020-11-23 10:01:59,371 [ 246171] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile constructor message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.ConstructorAnalysisError(Cannot run program "make" (in directory "D:\Werkstudent\XWF\XT_Einzelauswertung"): CreateProcess error=2, The system cannot find the file specified)
2020-11-23 10:01:59,381 [ 246181] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile analyzer message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.TargetsAnalyzerError(Cannot run program "make" (in directory "D:\Werkstudent\XWF\XT_Einzelauswertung"): CreateProcess error=2, The system cannot find the file specified)
2020-11-23 10:01:59,382 [ 246182] DEBUG - om.jetbrains.cidr.cpp.makefile - Channel closed coroutine name = StandaloneCoroutine{Completed}@a7d27cb
2020-11-23 10:01:59,382 [ 246182] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile constructor message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.ConstructorAnalysisStatus(Makefile analysis finished. Success = false)
2020-11-23 10:01:59,383 [ 246183] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile constructor message: com.jetbrains.cidr.cpp.makefile.project.resolver.messages.CriticalConstructorAnalysisError(No compilation commands found)
2020-11-23 10:01:59,386 [ 246186] DEBUG - om.jetbrains.cidr.cpp.makefile - Channel closed coroutine name = StandaloneCoroutine{Completed}@258f8a01
2020-11-23 10:01:59,386 [ 246186] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile constructor message: ModuleStructureMessage(moduleStructure=ModuleData: XT_Einzelauswertung)
2020-11-23 10:01:59,387 [ 246187] DEBUG - om.jetbrains.cidr.cpp.makefile - Makefile analysis finished at: 10:01:59 id: analysis:aa0e0ae1-8957-4100-b93e-e389cbdb8646
result: failure
2020-11-23 10:01:59,387 [ 246187] DEBUG - om.jetbrains.cidr.cpp.makefile - Channel closed coroutine name = StandaloneCoroutine{Completed}@66027050
2020-11-23 10:01:59,416 [ 246216] INFO - System.util.ExternalSystemUtil - External project [D:/Werkstudent/XWF/XT_Einzelauswertung] resolution task executed in 1419 ms.
2020-11-23 10:01:59,778 [ 246578] INFO - ge.ExternalProjectsDataStorage - Save external projects data in 20 ms
我做错了什么,为什么CLion找不到make可执行文件?确定找到了解决方案
@尤塔是对的。CLion可以找到make可执行文件,但是make依赖于一堆它找不到的其他coreutil
因此,我必须将C:\msys64\mingw64\bin
和C:\msys64\usr\bin
添加到我的windows路径中
我怎么知道的?
在mingw终端中执行mingw32 make
,效果良好因此,我在CLion内部的终端中执行了
mingw32 make clean
,这给了我描述的错误。因此,错误消息不是来自CLion,而是来自make
命令本身之后,我尝试将这两条路径添加到CLion内部的PATH中,但找不到相应的选项。因此,最终我必须将其添加到系统环境变量中。我还不知道这是否因为可执行文件名的冲突而把其他东西搞砸了
哦,现在我在“配置项目”步骤中遇到错误,可能是因为解析错误。代码=127意味着可执行模块没有找到DLL。在您的情况下,这意味着带有
make
的文件夹不在路径中。但它在构建、执行、部署->工具链中自动检测到make可执行文件的完整路径,如C:\msys64\mingw64\bin\mingw32 make.exe
,因此这不重要。谢谢!还为我的同事cygwin工作:)