Eclipse使错误127

这是我第一次使用Eclipse,也是我第一次在linux环境下编程。 所以我最终可能会发布一些半无用的信息,但我只是想尽可能详细地提供。

问题:我试图build立一个项目,我得到以下错误和警告。

问题:在IDE中,为了开始在linux中使用c ++,我需要做些什么和/或得到什么? 解决这个错误会很好,但是上面提到的是我的基本目标。

IDE信息:

Eclipse Version: Helios Release Build id: 20100617-1415 

OS信息:

 Fedora 13: i686 

错误(1项)

 make: *** [src/xoorMath.o] Error 127 xoorMath C/C++ Problem 

警告(2项)

 Error launching external scanner info generator (g++ -E -P -v -dD /home/xoorath/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp) xoorMath Unknown C/C++ Problem Error launching external scanner info generator (g++ -E -P -v -dD /home/xoorath/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp) xoorMath Unknown C/C++ Problem 

源代码

 //============================================================================ // Name : xoorMath.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> using namespace std; int main() { cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! return 0; } 

生成的Makefile

 ################################################################################ # Automatically-generated file. Do not edit! ################################################################################ -include ../makefile.init RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk -include src/subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C++_DEPS)),) -include $(C++_DEPS) endif ifneq ($(strip $(C_DEPS)),) -include $(C_DEPS) endif ifneq ($(strip $(CC_DEPS)),) -include $(CC_DEPS) endif ifneq ($(strip $(CPP_DEPS)),) -include $(CPP_DEPS) endif ifneq ($(strip $(CXX_DEPS)),) -include $(CXX_DEPS) endif ifneq ($(strip $(C_UPPER_DEPS)),) -include $(C_UPPER_DEPS) endif endif -include ../makefile.defs # Add inputs and outputs from these tool invocations to the build variables # All Target all: xoorMath # Tool invocations xoorMath: $(OBJS) $(USER_OBJS) @echo 'Building target: $@' @echo 'Invoking: GCC C++ Linker' g++ -o"xoorMath" $(OBJS) $(USER_OBJS) $(LIBS) @echo 'Finished building target: $@' @echo ' ' # Other Targets clean: -$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) xoorMath -@echo ' ' .PHONY: all clean dependents .SECONDARY: -include ../makefile.targets 

编辑尝试运行'gcc -E -P -v -dD /home/xoorath/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp'

 [root@wt227-09-fedora xoorath]# gcc -E -P -v -dD /home/xoorath/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp Using built-in specs. Target: i686-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux Thread model: posix gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) COLLECT_GCC_OPTIONS='-E' '-P' '-v' '-dD' '-mtune=generic' '-march=i686' cc1plus -E -quiet -v -P -D_GNU_SOURCE /home/xoorath/workspace/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp -mtune=generic -march=i686 -dD gcc: error trying to exec 'cc1plus': execvp: No such file or directory [root@wt227-09-fedora xoorath]# 

简单的解决方案。 原来我没有g ++。 我安装了gcc,而且这里有人知道这个区别,如果有的话可以随时给我启发。

我不得不进入控制台,并执行以下操作

 yum install gcc-c++ 

而已。

以下是make返回的值。

0 – 如果所有makefile成功解析,并且没有构建的目标失败1 – 如果使用-q标志并且make确定需要重建目标2 – 是否遇到任何错误。

和任何形式的错误号码,

'[foo]错误NN'[foo]信号描述'这些错误根本不是真正的错误。 它们意味着作为配方一部分被调用的程序返回非0错误代码('错误NN'),这会使解释失败,或以某种其他异常方式(使用某种类型的信号)退出。

如果消息中没有附加* ,则子进程失败,但是makefile中的规则前缀为 – 特殊字符,因此忽略该错误。

那么,这里做返回值127的情况,是由shell返回的。 请参阅bash的man页。