Can't compile: No rule to make target `Debug/main.o'

CodeLite installation/troubleshooting forum
User avatar
Marcel
CodeLite Enthusiast
Posts: 17
Joined: Tue May 14, 2013 1:05 am
Genuine User: Yes
IDE Question: c++
Contact:

Can't compile: No rule to make target `Debug/main.o'

Post by Marcel »

Hi,

I am trying to build a simple "Hello World" application. But "make" always fails:

Code: Select all

C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 4 -e -f  "CppTest3_wsp.mk""
----------Building project:[ CppTest3 - Debug ]----------
mingw32-make[1]: *** No rule to make target `Debug/main.o', needed by `Debug/CppTest3'.  Stop.
mingw32-make[1]: *** Waiting for unfinished jobs....
mingw32-make[1]: Entering directory `D:/Development/workspaces/CppTest3'
mingw32-make.exe: *** [All] Error 2
mingw32-make[1]: Leaving directory `D:/Development/workspaces/CppTest3'
CppTest3_wsp.mk:4: recipe for target `All' failed
0 errors, 0 warnings


Same when running this in CMD:

Code: Select all

mingw32-make.exe -j 4 -e -f  "CppTest3_wsp.mk"
This is the makefile:

Code: Select all

##
## Auto Generated makefile by CodeLite IDE
## any manual changes will be erased      
##
## Debug
ProjectName            :=CppTest3
ConfigurationName      :=Debug
WorkspacePath          := "D:\Development\workspaces\CppTest3"
ProjectPath            := "D:\Development\workspaces\CppTest3"
IntermediateDirectory  :=./Debug
OutDir                 := $(IntermediateDirectory)
CurrentFileName        :=
CurrentFilePath        :=
CurrentFileFullPath    :=
User                   :=Marcel
Date                   :=13.05.2013
CodeLitePath           :="D:\Development\CodeLite"
LinkerName             :=g++
SharedObjectLinkerName :=g++ -shared -fPIC
ObjectSuffix           :=.o
DependSuffix           :=.o.d
PreprocessSuffix       :=.o.i
DebugSwitch            :=-gstab
IncludeSwitch          :=-I
LibrarySwitch          :=-l
OutputSwitch           :=-o 
LibraryPathSwitch      :=-L
PreprocessorSwitch     :=-D
SourceSwitch           :=-c 
OutputFile             :=$(IntermediateDirectory)/$(ProjectName)
Preprocessors          :=
ObjectSwitch           :=-o 
ArchiveOutputSwitch    := 
PreprocessOnlySwitch   :=-E 
ObjectsFileList        :="CppTest3.txt"
PCHCompileFlags        :=
MakeDirCommand         :=makedir
RcCmpOptions           := 
RcCompilerName         :=windres
LinkOptions            :=  
IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). 
IncludePCH             := 
RcIncludePath          := 
Libs                   := 
ArLibs                 :=  
LibPath                := $(LibraryPathSwitch). 

##
## Common variables
## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables
##
AR       := ar rcus
CXX      := g++
CC       := gcc
CXXFLAGS :=  -g -O0 -Wall $(Preprocessors)
CFLAGS   :=  -g -O0 -Wall $(Preprocessors)


##
## User defined environment variables
##
CodeLiteDir:=D:\Development\CodeLite
UNIT_TEST_PP_SRC_DIR:=C:\UnitTest++-1.3
Srcs=main.cpp 

Objects0=$(IntermediateDirectory)/main$(ObjectSuffix) 



Objects=$(Objects0) 

##
## Main Build Targets 
##
.PHONY: all clean PreBuild PrePreBuild PostBuild
all: $(OutputFile)

$(OutputFile): $(IntermediateDirectory)/.d $(Objects) 
	@$(MakeDirCommand) $(@D)
	@echo "" > $(IntermediateDirectory)/.d
	@echo $(Objects0)  > $(ObjectsFileList)
	$(LinkerName) $(OutputSwitch)$(OutputFile) $(Objects) $(LibPath) $(Libs) $(LinkOptions)

$(IntermediateDirectory)/.d:
	@$(MakeDirCommand) "./Debug"

PreBuild:
##
## Clean
##
clean:
	$(RM) $(IntermediateDirectory)/main$(ObjectSuffix)
	$(RM) $(IntermediateDirectory)/main$(DependSuffix)
	$(RM) $(IntermediateDirectory)/main$(PreprocessSuffix)
	$(RM) $(OutputFile)
	$(RM) $(OutputFile).exe
	$(RM) ".build-debug/CppTest3"
System:
Windows 8 Pro
gcc 4.7.2 (mingw)
CodeLite (without mingw and with mingw, tried both).

I guess the makefile is the problem, but I am not that much into makefiles to see it. Maybe some eagle eye can help me out :(
Other IDEs work fine, but code completition sucks ;D

Thanks in advance,

Marcel

Edit:
The Project:
Image
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can't compile: No rule to make target `Debug/main.o'

Post by eranif »

What you describe here simply can not happen... not according to the code at least.
Your Makefile should have this line "## Objects" without any condition (even if there are no files to compile) - but yet it is not there

Its like the entire files target has been skipped in a magically way from your Makefile

Can you please zip your project and upload it?
In addition, which version of codelite are you using?

Eran
Make sure you have read the HOW TO POST thread
User avatar
Marcel
CodeLite Enthusiast
Posts: 17
Joined: Tue May 14, 2013 1:05 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Can't compile: No rule to make target `Debug/main.o'

Post by Marcel »

Hi Eran,

I am using Codelite 5.1. I also tried the option "Pass object list to the linker via file". Didn't change anything for me.
(How should it hehe, but that was the only option I was messing around with)

Added my project to the attachment. Hope this helps to figure it out (this happens with all new g++ or gcc projects.)
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can't compile: No rule to make target `Debug/main.o'

Post by eranif »

Hi,

I loaded the project in my codelite and it compiles without a problem.

Try this:
- Close codelite
- Delete the folder %AppData%\CodeLite
- Start codelite

try to compile the project again
Eran
Make sure you have read the HOW TO POST thread
User avatar
Marcel
CodeLite Enthusiast
Posts: 17
Joined: Tue May 14, 2013 1:05 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Can't compile: No rule to make target `Debug/main.o'

Post by Marcel »

Hi Eran,

Wow, deleting the folder worked like a charm. Hope this does not happen again, after I set up codelite to my needs. :)
If you are interessted, I made a backup of the data.

Thank you very much :)

Edit:
Btw.: Zmrok Layout looks cool and better on my monitor :)
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can't compile: No rule to make target `Debug/main.o'

Post by eranif »

Marcel wrote:Btw.: Zmrok Layout looks cool and better on my monitor
git head contains even better version of the dark theme (both Zmrok & DarkTheme)

Here is how it looks on the current git head:
1.png
Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
User avatar
Marcel
CodeLite Enthusiast
Posts: 17
Joined: Tue May 14, 2013 1:05 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Can't compile: No rule to make target `Debug/main.o'

Post by Marcel »

Wow,

I guess I will then have to get the latest :D Looks awesome!!!
Post Reply