GRRLIB Help March 16, 2009 11:38PM | Registered: 15 years ago Posts: 444 |
GRRLIB.c linking ... pong.elf d:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-gekko/bin/ld.exe: cannot find -lpng collect2: ld returned 1 exit status make[1]: *** [/d/homebrew/mystuff/pong/pong.elf] Error 1 "make": *** [build] Error 2
Re: GRRLIB Help March 16, 2009 11:43PM | Registered: 15 years ago Posts: 83 |
Re: GRRLIB Help March 17, 2009 12:51AM | Registered: 15 years ago Posts: 444 |
main.c In file included from d:/Homebrew/mystuff/Pong/source/GRRLIB/../libjpeg/jpeglib.h:26, from d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.c:16, from d:/Homebrew/mystuff/Pong/source/main.c:10: d:/Homebrew/mystuff/Pong/source/GRRLIB/../libjpeg/jmorecfg.h:227: error: conflicting types for 'u8' d:/devkitPro/libogc/include/gctypes.h:15: error: previous declaration of 'u8' was here In file included from d:/Homebrew/mystuff/Pong/source/main.c:10: d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.c:80: error: conflicting types for 'GRRLIB_Rectangle' d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.h:74: error: previous declaration of 'GRRLIB_Rectangle' was here d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.c:828: error: conflicting types for 'GRRLIB_GXEngine' d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.h:109: error: previous declaration of 'GRRLIB_GXEngine' was here d:/Homebrew/mystuff/Pong/source/main.c:14: error: conflicting types for 'xfb' d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.c:23: error: previous definition of 'xfb' was here d:/Homebrew/mystuff/Pong/source/main.c:15: error: static declaration of 'rmode' follows non-static declaration d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.c:24: error: previous declaration of 'rmode' was here make[1]: *** [main.o] Error 1 "make": *** [build] Error 2 > Process Exit Code: 2 > Time Taken: 00:02
Re: GRRLIB Help March 17, 2009 02:17AM | Registered: 15 years ago Posts: 83 |
In file included from d:/Homebrew/mystuff/Pong/source/GRRLIB/../libjpeg/jpeglib.h:26I'm assuming from this you're trying to load a jpg file? I don't use jpegs in my project at all, all of my graphics are .PNG which are converted to .h files using WiiBuilder 1.0. I think last time I tried to use the jpeglib, it didn't work for me either.
d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.c:80: error: conflicting types for 'GRRLIB_Rectangle' d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.h:74: error: previous declaration of 'GRRLIB_Rectangle' was here d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.c:828: error: conflicting types for 'GRRLIB_GXEngine' d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.h:109: error: previous declaration of 'GRRLIB_GXEngine' was here d:/Homebrew/mystuff/Pong/source/main.c:14: error: conflicting types for 'xfb' d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.c:23: error: previous definition of 'xfb' was here d:/Homebrew/mystuff/Pong/source/main.c:15: error: static declaration of 'rmode' follows non-static declaration d:/Homebrew/mystuff/Pong/source/GRRLIB/GRRLIB.c:24: error: previous declaration of 'rmode' was hereHmm....maybe post your Makefile, cus it sounds like it's trying to pull from the GRRLIB files in your project source, as well as from another source, and they're conflicting.
source/GRRLIB source/GRRLIB/fonts
Re: GRRLIB Help March 17, 2009 11:24PM | Registered: 15 years ago Posts: 444 |
#--------------------------------------------------------------------------------- # 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 source/gfx source/libpng source/libpng/pngu source/libjpg source/libjpg/pngu 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 := -lpng -ljpeg -lz -lfat -lwiiuse -lbte -logc -lm #--------------------------------------------------------------------------------- # 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 #---------------------------------------------------------------------------------
Re: GRRLIB Help March 17, 2009 11:48PM | Admin Registered: 16 years ago Posts: 5,132 |
#--------------------------------------------------------------------------------- # This rule links in binary data with the .png extension #--------------------------------------------------------------------------------- %.png.o : %.png #--------------------------------------------------------------------------------- @echo $(notdir $<) $(bin2o) -include $(DEPENDS)
Re: GRRLIB Help March 18, 2009 12:17AM | Registered: 15 years ago Posts: 444 |
main.c In file included from d:/homebrew/mystuff/pong/source/GRRLIB/../libjpeg/jpeglib.h:26, from d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:16, from d:/homebrew/mystuff/pong/source/main.c:10: d:/homebrew/mystuff/pong/source/GRRLIB/../libjpeg/jmorecfg.h:227: error: conflicting types for 'u8' d:/devkitPro/libogc/include/gctypes.h:15: error: previous declaration of 'u8' was here In file included from d:/homebrew/mystuff/pong/source/main.c:10: d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:80: error: conflicting types for 'GRRLIB_Rectangle' d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.h:74: error: previous declaration of 'GRRLIB_Rectangle' was here d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:828: error: conflicting types for 'GRRLIB_GXEngine' d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.h:109: error: previous declaration of 'GRRLIB_GXEngine' was here d:/homebrew/mystuff/pong/source/main.c:14: error: conflicting types for 'xfb' d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:23: error: previous definition of 'xfb' was here d:/homebrew/mystuff/pong/source/main.c:15: error: static declaration of 'rmode' follows non-static declaration d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:24: error: previous declaration of 'rmode' was here make[1]: *** [main.o] Error 1 "make": *** [build] Error 2 > Process Exit Code: 2 > Time Taken: 00:01
Re: GRRLIB Help March 18, 2009 12:25AM | Admin Registered: 16 years ago Posts: 5,132 |
Re: GRRLIB Help March 18, 2009 12:45AM | Registered: 15 years ago Posts: 444 |
VIDEO_Init(); WPAD_Init(); GRRLIB_Init(); rmode = VIDEO_GetPreferredMode(NULL); xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); VIDEO_Configure(rmode); VIDEO_SetNextFramebuffer(xfb); VIDEO_SetBlack(FALSE); VIDEO_Flush(); VIDEO_WaitVSync(); if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); WPAD_SetDataFormat(0, WPAD_FMT_BTNS_ACC_IR); WPAD_SetVRes(0, 640, 480); }
Re: GRRLIB Help March 18, 2009 01:53AM | Registered: 15 years ago Posts: 83 |
VIDEO_Init(); WPAD_Init(); GRRLIB_Init(); rmode = VIDEO_GetPreferredMode(NULL); xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); VIDEO_Configure(rmode); VIDEO_SetNextFramebuffer(xfb); VIDEO_SetBlack(FALSE); VIDEO_Flush(); VIDEO_WaitVSync(); if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); WPAD_SetDataFormat(0, WPAD_FMT_BTNS_ACC_IR); WPAD_SetVRes(0, 640, 480); }To this:
GRRLIB_InitVideo(); WPAD_Init(); console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); WPAD_SetDataFormat(0, WPAD_FMT_BTNS_ACC_IR); WPAD_SetVRes(0, 640, 480); }
Re: GRRLIB Help March 18, 2009 02:30AM | Registered: 15 years ago Posts: 444 |
main.c In file included from d:/homebrew/mystuff/pong/source/GRRLIB/../libjpeg/jpeglib.h:26, from d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:16, from d:/homebrew/mystuff/pong/source/main.c:10: d:/homebrew/mystuff/pong/source/GRRLIB/../libjpeg/jmorecfg.h:227: error: conflicting types for 'u8' d:/devkitPro/libogc/include/gctypes.h:15: error: previous declaration of 'u8' was here In file included from d:/homebrew/mystuff/pong/source/main.c:10: d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:80: error: conflicting types for 'GRRLIB_Rectangle' d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.h:74: error: previous declaration of 'GRRLIB_Rectangle' was here d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:828: error: conflicting types for 'GRRLIB_GXEngine' d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.h:109: error: previous declaration of 'GRRLIB_GXEngine' was here d:/homebrew/mystuff/pong/source/main.c:14: error: conflicting types for 'xfb' d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:23: error: previous definition of 'xfb' was here d:/homebrew/mystuff/pong/source/main.c:15: error: static declaration of 'rmode' follows non-static declaration d:/homebrew/mystuff/pong/source/GRRLIB/GRRLIB.c:24: error: previous declaration of 'rmode' was here d:/homebrew/mystuff/pong/source/main.c: In function 'Initialise': d:/homebrew/mystuff/pong/source/main.c:48: warning: implicit declaration of function 'GRRLIB_InitVideo' make[1]: *** [main.o] Error 1 "make": *** [build] Error 2
Re: GRRLIB Help March 18, 2009 02:34AM | Admin Registered: 16 years ago Posts: 5,132 |
Re: GRRLIB Help March 18, 2009 02:52AM | Registered: 15 years ago Posts: 444 |
main.c d:/homebrew/mystuff/pong/source/main.c: In function 'Initialise': d:/homebrew/mystuff/pong/source/main.c:48: warning: implicit declaration of function 'GRRLIB_InitVideo' linking ... pong.elf d:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-gekko/bin/ld.exe: cannot find -lpng collect2: ld returned 1 exit status make[1]: *** [/d/homebrew/mystuff/pong/pong.elf] Error 1 "make": *** [build] Error 2
Re: GRRLIB Help March 18, 2009 03:12AM | Registered: 15 years ago Posts: 83 |
Re: GRRLIB Help March 18, 2009 03:16AM | Registered: 15 years ago Posts: 444 |
ain.c d:/homebrew/mystuff/pong/source/main.c: In function 'Initialise': d:/homebrew/mystuff/pong/source/main.c:48: warning: implicit declaration of function 'GRRLIB_InitVideo' linking ... pong.elf main.o: In function `Initialise': d:/homebrew/mystuff/pong/source/main.c:48: undefined reference to `GRRLIB_InitVideo' main.o: In function `main': d:/homebrew/mystuff/pong/source/main.c:105: undefined reference to `GRRLIB_Render' d:/homebrew/mystuff/pong/source/main.c:138: undefined reference to `GRRLIB_Render' collect2: ld returned 1 exit status make[1]: *** [/d/homebrew/mystuff/pong/pong.elf] Error 1 "make": *** [build] Error 2
Re: GRRLIB Help March 18, 2009 05:20AM | Registered: 15 years ago Posts: 83 |
Re: GRRLIB Help March 18, 2009 11:07PM | Registered: 15 years ago Posts: 444 |
main.c d:/homebrew/mystuff/pong/source/main.c:14: error: expected identifier or '(' before string constant d:/homebrew/mystuff/pong/source/main.c: In function 'Initialise': d:/homebrew/mystuff/pong/source/main.c:52: warning: implicit declaration of function 'GRRLIB_InitVideo' make[1]: *** [main.o] Error 1 "make": *** [build] Error 2
Re: GRRLIB Help March 18, 2009 11:57PM | Admin Registered: 16 years ago Posts: 5,132 |
Re: GRRLIB Help March 19, 2009 12:32AM | Registered: 15 years ago Posts: 444 |
Re: GRRLIB Help March 19, 2009 10:10AM | Registered: 15 years ago Posts: 25 |
LIBDIRS := $(CURDIR)to the Makefile to add the lib folder of your project to the directories the linker is searching for libraries. Finally tell the linker which libraries to link by adding -lpng -ljpeg to that line of your Makefile:
LIBS := -lz -lwiiuse -lbte -logc -lm