我正在开发 Ubuntu 16.04 和 Netbeans 8.0.2
我删除了一个源文件和相应的头文件,因为我不再使用它了。 当我想编译我的代码(干净+构建)时,我收到以下错误:
make[2]: *** no rule to make target source_files/SolveODEwithAST.cpp“,
benötigt von „build/Debug/GNU-Linux-x86/source_files/SolveODEwithAST.o“, zu erstellen. Schluss.
-> 我的制作文件仍在查找已删除的文件。 我开始在makefile中搜索编译此已删除文件的命令:
我发现了以下内容: 在 Makefile-release:
${OBJECTDIR}/source_files/SolveODEwithAST.o: source_files/SolveODEwithAST.cpp
${MKDIR} -p ${OBJECTDIR}/source_files
${RM} "$@.d"
$(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/source_files/SolveODEwithAST.o source_files/SolveODEwithAST.cpp
它是在对象文件变量中定义的。
我删除了这些代码行,但这些行在构建代码后重新出现。
那么如何更改我的生成文件以使我的代码再次工作呢?
对于项目/nbproject 目录中的所有文件,我搜索了已删除的文件名。
$ls
configurations.xml Makefile-Debug.mk Makefile-impl.mk Makefile-Release.mk Makefile-variables.mk Package-Debug.bash Package-Release.bash private project.xml
删除.xml文件中的相应行非常重要。 当我只是删除 Makefile 中的相应行时,这些行会重新出现。