首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >CLion无法运行程序“让”系统找不到指定的文件

CLion无法运行程序“让”系统找不到指定的文件
EN

Stack Overflow用户
提问于 2020-11-23 09:13:47
回答 1查看 5.8K关注 0票数 5

在CLion中打开makefile项目时,我会得到以下错误消息:

代码语言:javascript
运行
复制
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

我使用的是Windows.

  • mingw-w64-x86_64-toolchain上的mingw64,安装在msys2上。

  • Build, Execution, Deployment -> Toolchains中添加了MinGW和环境C:\msys64\mingw64。Make,C编译器和C++编译器都被正确地检测到了。

  • Build, Execution, Deployment -> Build Tools -> Make中设置了将可执行文件设置为

的路径

CLion的相关调试日志:

代码语言:javascript
运行
复制
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可执行文件?

EN

Stack Overflow用户

回答已采纳

发布于 2020-11-25 09:03:55

找到解决办法了。

@uta在comment中是对的。CLion可以找到make可执行文件,但依赖于其他一些它无法找到的核心程序。

所以我不得不将C:\msys64\mingw64\binC:\msys64\usr\bin添加到我的windows路径中。

我是怎么想出来的?在mingw终端中执行mingw32-make很好。

因此,我在CLion内部的终端中执行了CLion,这给了我描述的错误。因此,错误消息不是来自CLion,而是来自make命令本身。

之后,我尝试只在CLion中将这两条路径添加到路径中,但找不到它的选项。因此,最终我不得不将它添加到系统环境变量中。还不知道这是不是因为可执行名称的冲突而把其他事情搞砸了。

哦,现在我收到了“配置项目”步骤中的错误,可能是因为解析错误。

票数 4
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64965494

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档