Makefile错误make(e = 2):系统找不到指定的文件 [英] Makefile error make (e=2): The system cannot find the file specified

查看:2462
本文介绍了Makefile错误make(e = 2):系统找不到指定的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows中使用一个makefile来将某些文件推送到Unix服务器上(这里是我的makefile所在文件夹中的文本文件"blob.txt"). 我的makefile脚本是:

I am using a makefile in windows to push some files on a Unix server (here a text file "blob.txt" in the same folder of my makefile). My makefile script is:

setup:
        pscp blob.txt username@hostname:/folder/

我启动命令提示符,进入存在blob.txt和makefile的文件夹,然后键入:

I start a command prompt, go in the folder where blob.txt and the makefile are present and type:

make setup

这将导致:

pscp blob.txt username@hostname:/folder/
process_begin: CreateProcess(NULL, pscp blob.txt username@hostname:/folder/, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [setup] Error 2

在#fail中...而如果我直接在命令提示符下输入命令:

In a #fail ... whereas if I enter directly the command in the command prompt:

pscp blob.txt username@hostname:/folder/

它起作用了……我真的很奇怪为什么.

It works ... I really wonder why.

推荐答案

错误

process_begin: CreateProcess(NULL, pscp blob.txt username@hostname:/folder/, ...) failed.
make (e=2): The system cannot find the file specified.

几乎可以肯定地抱怨Windows无法找到pscp.

is almost certainly complaining that Windows cannot find pscp.

这几乎可以肯定是因为当make生成外壳/控制台然后手动打开它时,%PATH%(或其他值)的值是不同.

This is almost certainly because the value of %PATH% (or whatever) is different when make spawns a shell/console then when you have it open manually.

比较这些值以确认这一点.然后,使用Makefile配方中pscp的完整路径,或者确保为make的使用正确设置PATH的值.

Compare the values to confirm that. Then either use the full path to pscp in the makefile recipe or ensure that the value of PATH is set correctly for make's usage.

这篇关于Makefile错误make(e = 2):系统找不到指定的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆