Undefined reference to initGraphics(), blitAlphaImag... etc.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Crux
Posts: 10
Joined: Sun May 25, 2008 1:46 pm

Undefined reference to initGraphics(), blitAlphaImag... etc.

Post by Crux »

undefined reference to initGraphics(), loadImage(), blitAlphaImageToScreen, and flipScreen()

Thats basically the error its throwing. I'm wondering is this because of my lack of correctly installing something? I have the make file correctly pointed to graphics.h and framebuffer.h but it doesn't seem to want to work.

Any ideas?

Code: Select all

TARGET = hello
OBJS = main.o ../includes/graphics.o ../includes/framebuffer.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LIBS = -lpspgu -lpng -lz -lm
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Tutorial

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

SDL?? LUA??? GU??
jsharrad
Posts: 100
Joined: Thu Oct 20, 2005 3:06 am

Post by jsharrad »

If you're using c++, you need to wrap those graphics headers in an 'extern "C" { }', although I don't see you linking the c++ library so that may not be your problem. ;)
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

are you sure the path is correct?
../ means one directory up, remember that. (I guess you already know)
did you add graphics.h to your includes?
#include <graphics.h>
Image
Upgrade your PSP
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Pirate's right... that path is funky. Who puts a c file in the INCLUDES directory? You're telling the compiler to compile the files "graphics.c" and "framebuffer.c" from the directory "../includes". While the h files may be there, I rather doubt the c files are.
Crux
Posts: 10
Joined: Sun May 25, 2008 1:46 pm

Post by Crux »

Hey guys thanks for all the replies (and the laugh from Wally4000)

And yes I am running tests in one folder while I am actually compiling the final program in another. So the path ../ is correct (I know it seems silly but it keeps things organized for me). The C++ files and the Header files are both located in there.

I decided the best route was to restart the cygwin installation, so i've removed everything and started over. I'll reply here if it fixes. If anyone else has any other suggestions that would be great. Thanks!

EDIT: Also graphics.h is in the includes.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Crux wrote: EDIT: Also graphics.h is in the includes.
Look at your object line again:

Code: Select all

OBJS = main.o ../includes/graphics.o ../includes/framebuffer.o
That says look for graphics.c and framebuffer.c in "../includes/", not the h files.
Post Reply