Welcome! Log In Create A New Profile

Advanced

compile error

Posted by ketufe 
compile error
February 16, 2010 10:01PM
hi
I just made a program
when I compile
I have a message "No rule to make target 'fat.o' needed by C / ...... / template / template.elf.stop.

can you help me
thank you
Re: compile error
February 16, 2010 11:42PM
Did you use the Makefile from the template folder:
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC")
endif

include $(DEVKITPPC)/wii_rules

#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET		:=	$(notdir $(CURDIR))
BUILD		:=	build
SOURCES		:=	source
DATA		:=	data  
INCLUDES	:=

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------

CFLAGS	= -g -O2 -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGS	=	$(CFLAGS)

LDFLAGS	=	-g $(MACHDEP) -Wl,-Map,$(notdir $@).map

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS	:=	-lwiiuse -lbte -logc -lm

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS	:=

#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------

export OUTPUT	:=	$(CURDIR)/$(TARGET)

export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
					$(foreach dir,$(DATA),$(CURDIR)/$(dir))

export DEPSDIR	:=	$(CURDIR)/$(BUILD)

#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
BINFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))

#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
	export LD	:=	$(CC)
else
	export LD	:=	$(CXX)
endif

export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
					$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
					$(sFILES:.s=.o) $(SFILES:.S=.o)

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDE	:=	$(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
					-I$(CURDIR)/$(BUILD) \
					-I$(LIBOGC_INC)

#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS	:=	$(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
					-L$(LIBOGC_LIB)

export OUTPUT	:=	$(CURDIR)/$(TARGET)
.PHONY: $(BUILD) clean

#---------------------------------------------------------------------------------
$(BUILD):
	@[ -d $@ ] || mkdir -p $@
	@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile

#---------------------------------------------------------------------------------
clean:
	@echo clean ...
	@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol

#---------------------------------------------------------------------------------
run:
	wiiload $(TARGET).dol


#---------------------------------------------------------------------------------
else

DEPENDS	:=	$(OFILES:.o=.d)

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

#---------------------------------------------------------------------------------
# This rule links in binary data with the .jpg extension
#---------------------------------------------------------------------------------
%.jpg.o	:	%.jpg
#---------------------------------------------------------------------------------
	@echo $(notdir $<)
	$(bin2o)

-include $(DEPENDS)

#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
If no, try to use it.
Re: compile error
February 16, 2010 11:55PM
If you have a problem with something called fat.o, maybe you need to add -lfat in the LIBS section of your Makefile. It's difficult to say, because you did not post any code.
Re: compile error
February 17, 2010 03:47AM
The folder you store your project in (Usually C:/projects/wii/ThisIsTheFolderImTalkingAbout) can't have any spaces in it. For example, you cant name the folder Your Project, it has to be YourProject.
Re: compile error
February 17, 2010 08:47AM
hi
yet i have a another error
makefile:13:/opt/devkitppc/wii_rule:no such file or directoryOK
makefile:102:***missing separator. stop.

thank you for your help

Quote
crayon
If you have a problem with something called fat.o, maybe you need to add -lfat in the LIBS section of your Makefile. It's difficult to say, because you did not post any code.

it's ok

thank you


Quote
ketufe
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
DEVKITPRO = /opt/devkitPPC
DEVKITPPC = /opt/devkitPPC

ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC")
endif

#include $(DEVKITPPC)/wii_rules

#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := source source/libpng source/libpng/pngu
DATA := data
INCLUDES :=

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------

CFLAGS = -Os -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGS = $(CFLAGS)

LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lpng -lfat -lwiiuse -lbte -logc -lm -lz

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(CURDIR)

#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------

export OUTPUT := $(CURDIR)/$(TARGET)

export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))

export DEPSDIR := $(CURDIR)/$(BUILD)

#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))

#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
export LD := $(CC)
else
export LD := $(CXX)
endif

export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
$(sFILES:.s=.o) $(SFILES:.S=.o)

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) \
-I$(LIBOGC_INC)

#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
-L$(LIBOGC_LIB)

export OUTPUT := $(CURDIR)/$(TARGET)
.PHONY: $(BUILD) clean

#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@==================================>>>>>>?????
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile

#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol

#---------------------------------------------------------------------------------
run:
wiiload $(TARGET).dol


#---------------------------------------------------------------------------------
else

DEPENDS := $(OFILES:.o=.d)

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

#---------------------------------------------------------------------------------
# This rule links in binary data with the .jpg extension
#---------------------------------------------------------------------------------
%.jpg.o : %.jpg
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)

-include $(DEPENDS)

#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------



bests regards



Edited 4 time(s). Last edit at 02/17/2010 09:37AM by ketufe.
Re: compile error
February 17, 2010 04:16PM
Quote
Arikado
The folder you store your project in (Usually C:/projects/wii/ThisIsTheFolderImTalkingAbout) can't have any spaces in it. For example, you cant name the folder Your Project, it has to be YourProject.
I swear up and down that I had the same issue and this solved it.
Re: compile error
February 17, 2010 05:04PM
hi Arikado
super thank you I have compiled without error but I can not find it to test on my wii?
Can you help me?
greetings
Re: compile error
February 17, 2010 05:27PM
What do you mean? You can't find the compiled dol or elf file?

Normally the name of the dol file is suppose to be the name of your current folder because of this line in your Makefile:
TARGET := $(notdir $(CURDIR))
Re: compile error
February 17, 2010 05:28PM
Do you mean you can't find the output .dol/.elf file? Or do you mean you don't know how to run it with your Wii?
Re: compile error
February 17, 2010 05:35PM
thank you for your help this first program
I'm lost
yes I mean how to retrieve it .dol or elf
I. ppg?



Edited 1 time(s). Last edit at 02/17/2010 05:39PM by ketufe.
Re: compile error
February 17, 2010 05:43PM
Quote
ketufe
yes I mean how to retrieve it .dol or elf
Quote
Crayon
Normally the name of the dol file is suppose to be the name of your current folder because of this line in your Makefile:
TARGET := $(notdir $(CURDIR))
Re: compile error
February 17, 2010 05:43PM
A .dol and an .elf file should appear in the root of your project folder (Usually C:/projects/wii/thisisthefolderimtalkingabout) for you to run after a successful compilation.
Re: compile error
February 17, 2010 06:30PM
I can not
it gives me _____. ppg??
and not .elf or .dol
Re: compile error
February 17, 2010 06:36PM
What compiler/linker are you using. Are you using devkitPro with Programmer's Notepad?
Re: compile error
February 17, 2010 06:41PM
Re: compile error
February 17, 2010 06:43PM
In Programmer's Notepad do a Clean and then a Make and give the Output at the bottom. Here is an example:
> "make" 
main.c
linking ... template.elf
output ... template.dol

> Process Exit Code: 0
> Time Taken: 00:01
Re: compile error
February 17, 2010 07:11PM
no no
I get the error again missing sepator. stop.
Re: compile error
February 17, 2010 07:27PM
Could you please paste the complete text from the Output section.
Re: compile error
February 17, 2010 07:40PM
> "Make"
Makefile:102: *** missing separator. stop.

> Process Exit Code: 2
> Time Taken: 00:01





Edited 1 time(s). Last edit at 02/17/2010 07:54PM by ketufe.
Re: compile error
February 17, 2010 07:43PM
It's saying you have crap on line 102 of your Makefile. And if you look at it, you have:
$(BUILD):
@[ -d $@ ] || mkdir -p $@==================================>>>>>>?????
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
You should have:
$(BUILD):
	@[ -d $@ ] || mkdir -p $@
	@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile

Sorry, only registered users may post in this forum.

Click here to login