C++ Eclipse Helios - “无法运行程序制作;未知原因”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4762578/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse Helios - "cannot run program make; unknown reason"
提问by Ravi
I upgraded Eclipse from Galileo to Helios, and when I try doing "Clean Project", I get an error saying "cannot run program make; unknown reason". I was able to run make in Galileo, so I'm not sure why this is happening, and whether anyone else encountered this.
我将 Eclipse 从 Galileo 升级到 Helios,当我尝试执行“Clean Project”时,出现“无法运行程序 make;原因不明”的错误消息。我能够在伽利略中运行 make,所以我不确定为什么会发生这种情况,以及是否有其他人遇到过这种情况。
回答by trojanfoe
Add PATH to the environment (Preferences -> C/C++ -> Build -> Environment).
将 PATH 添加到环境中(首选项 -> C/C++ -> 构建 -> 环境)。
I also had to add $ORACLE_HOME to the environment as well (my code uses Pro*C) - looks like CDT isn't picking-up the user's environment variables when it was before.
我还必须将 $ORACLE_HOME 添加到环境中(我的代码使用 Pro*C) - 看起来 CDT 没有在以前获取用户的环境变量。
It's annoying, I know...
这很烦人,我知道...
回答by elizeu
An alternative answer that builds on trojanfoe's above.
建立在上述特洛伊木马病毒之上的另一种答案。
Assuming you can run make in your native environment shell, the solution depends on whether you selected "Replace native environment with specified one" (OP1) or "Append variables to native environment" (OP2) in (Preferences -> C/C++ -> Build -> Environment):
假设您可以在本机环境 shell 中运行 make,解决方案取决于您是在 (Preferences -> C/C++ ->构建 -> 环境):
Solution-OP1: Add PATH to the environment (Preferences -> C/C++ -> Build -> Environment).
解决方案-OP1:将PATH添加到环境中(Preferences -> C/C++ -> Build -> Environment)。
I also had to add $ORACLE_HOME to the environment as well (my code uses Pro*C) - looks like CDT isn't picking-up the user's environment variables when it was before.
我还必须将 $ORACLE_HOME 添加到环境中(我的代码使用 Pro*C) - 看起来 CDT 没有在以前获取用户的环境变量。
It's annoying, I know...
这很烦人,我知道...
Solution-OP2: make sure the location of your make command in the PATH variable in your native environment.
解决方案-OP2:确保您的 make 命令在本机环境中的 PATH 变量中的位置。
回答by Hélder Rodrígues
I have found that in project -> properties -> C/C++build -> Environment, "Append variables to native environment" has to be chosen instead of "Replace native environment with specified one".
我发现在项目 -> 属性 -> C/C++build -> 环境中,必须选择“将变量附加到本机环境”而不是“用指定的替换本机环境”。
回答by jmcarter
Some amplification on this helpful information for OS X that I discovered this evening with Helios:
我今天晚上在 Helios 上发现了对 OS X 有用信息的一些放大:
my make was located in /Developer/usr/bin; I added this to the PATH variable.
我的 make 位于 /Developer/usr/bin;我将此添加到 PATH 变量中。
In the C/C++ Build -- Settings section of the project preferences, I added the /Developer/SDKs/MacOSX10.6.skd/usr/lib
directory. It includes the libraries you will need.
在项目首选项的 C/C++ Build -- Settings 部分,我添加了/Developer/SDKs/MacOSX10.6.skd/usr/lib
目录。它包括您需要的库。