无法编译文件
Makefile unable to compile file
Netbeans 7.3gcc 4.5.3
我看过这个问题的一些答案,但我没有看到我的具体情况。
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} $@.d
$(COMPILE.cc) -g -w -MMD -MP -MF $@.d -o ${OBJECTDIR}/SlipReadList.o SlipReadList.cpp
makefile看起来是正确的,并且可以用于其他文件。我已经验证了。cpp和。h文件在同一个目录下,并且与其他成功编译的文件在同一个目录下。有人知道是怎么回事吗?
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
相关文章:
- 使用 Makefile 中的头文件编译 Pybind (不使用 cmake)
- 如何使用命令提示符、记事本和 MinGW 使用主文件、头文件和实现文件编译C++程序?
- 无论如何可以将webm / mp4文件编译/记忆为.exe程序吗?(C++)
- 从生成文件编译错误:"Unable to open output file" ..."No such file or directory"
- 如何使用 GLFW 预编译的二进制文件编译 Visual Studio 2019 发布版本
- Arduino IDE中自定义库类的.h文件编译错误的原因是什么
- makefile和错误将与大型项目分开的文件编译
- 如何使用生成文件编译具有多个目录的 c++ 项目
- 我可以将Visual Studio 2015头文件编译成dll并在VS2013中使用它吗?
- 使用Bazel将C 文件编译为python.h
- 使用 .a 文件编译简单的C++文件
- OpenCV 3.2 文件编译
- 如何从多个 cpp 文件编译 WebAssembly
- 从多个文件编译可以"undefined reference"
- 使用静态依赖性为共享二进制文件编译语法需要更加清晰
- 将Gsoap Src文件编译到我的项目中
- 如何用多个文件编译make下的dlib
- 字段的类型不完整,从多个文件编译
- 强制将特定文件编译为Objective-C/文件类型,但将整个项目编译为Objective C++
- OpenGLES 标头(包括 Availability.h)可防止 CPP 文件编译