2013-04-02 134 views
1

的Netbeans 7.3 GCC 4.5.3Makefile文件无法编译文件

我看了一些这个问题的答案,但我看不到我的具体情况。

由Netbeans生成的makefile似乎是正确的。在Netbeans终端窗口中给出的输出给出了一个No rule to make target ReadList.cpp,这似乎是错误的。我无法弄清楚发生了什么事。

输出窗口显示:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf 
make[1]: Entering directory `/c/home/skidmarks/Projects/SLIP/slip' 
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/slip.exe 
make[2]: Entering directory `/c/home/skidmarks/Projects/SLIP/slip' 
make[2]: *** No rule to make target `ReadList.cpp', needed by `build/Debug/Cygwin_4.x-Windows/ReadList.o'. Stop. 
make[2]: Leaving directory `/c/home/skidmarks/Projects/SLIP/slip' 
nbproject/Makefile-Debug.mk:94: recipe for target `.build-conf' failed 
make[1]: *** [.build-conf] Error 2 
make[1]: Leaving directory `/c/home/skidmarks/Projects/SLIP/slip' 
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed 
make: *** [.build-impl] Error 2 


BUILD FAILED (exit value 2, total time: 375ms) 

Makefile中显示:

${OBJECTDIR}/SlipReadList.o: SlipReadList.cpp 
    ${MKDIR} -p ${OBJECTDIR} 
    ${RM} [email protected] 
    $(COMPILE.cc) -g -w -MMD -MP -MF [email protected] -o ${OBJECTDIR}/SlipReadList.o SlipReadList.cpp 

生成文件似乎正确,适用于其他文件。我已验证.cpp和.h文件与其他已成功编译的文件位于同一目录中,并位于同一目录中。任何人有一个想法是什么问题?

+0

那么错误表示缺少的文件是ReadList.cpp而不是SlipReadList.cpp – john

+0

那么有帮助。我没有ReadList.cpp(但我认为你已经解决了我的问题),签名和感谢。 –

回答

0
make[2]: *** No rule to make target `ReadList.cpp', needed by `build/Debug/Cygwin 

现在看看你的make文件:

${OBJECTDIR}/SlipReadList.o: SlipReadList.cpp 

你有readlist.cpp最初,但在makefile想要一个SlipReadList.cpp。因此,编译器不知道如何处理readlist.cpp。一个简单的解决方法是将文件的命名更改为SlipReadList.cpp