undefined reference intraFont

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

Moderators: cheriff, TyRaNiD

Post Reply
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

undefined reference intraFont

Post by coolkehon »

this is the error

Code: Select all

psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -I./header -I/usr/local/pspdev/include -I/usr/local/pspdev/psp/include -I/usr/local/pspdev/psp/include/c++/4.3.3 -I/usr/local/pspdev/psp/sdk/include  -I. -I/usr/local/pspdev/psp/sdk/include -I./header -I/usr/local/pspdev/include -I/usr/local/pspdev/psp/include -I/usr/local/pspdev/psp/include/c++/4.3.3 -I/usr/local/pspdev/psp/sdk/include  -fexceptions -frtti -D_PSP_FW_VERSION=150   -c -o src/Font.o src/Font.cpp
src/Font.cpp: In member function ‘void objdraw::Font::setEncoding(unsigned int)’:
src/Font.cpp:67: error: ‘intraFontSetEncoding’ was not declared in this scope
src/Font.cpp: In member function ‘void objdraw::Font::setAlternateFont(objdraw::Font*)’:
src/Font.cpp:72: error: ‘intraFontSetAltFont’ was not declared in this scope
src/Font.cpp: In member function ‘float objdraw::Font::printUCS2Ex(float, float, const short unsigned int*, int)’:
src/Font.cpp:87: error: ‘intraFontPrintUCS2Ex’ was not declared in this scope
src/Font.cpp: In member function ‘float objdraw::Font::printColumnUCS2(float, float, float, const short unsigned int*)’:
src/Font.cpp:93: error: ‘intraFontPrintColumnUCS2’ was not declared in this scope
src/Font.cpp: In member function ‘float objdraw::Font::printColumnUCS2Ex(float, float, float, const short unsigned int*, int)’:
src/Font.cpp:99: error: ‘intraFontPrintColumnUCS2Ex’ was not declared in this scope
make: *** [src/Font.o] Error 1
this is the makefile

Code: Select all

PSPSDK=$(shell psp-config --pspsdk-path)

TARGET_LIB = libobjdraw++.a

OBJS = 	src/Object.o \
		src/GraphicsInstance.o \
		src/Color.o \
		src/Location.o \
		src/KeyListener.o \
		src/CanvasManager.o \
		src/DrawingCanvas.o \
		src/DrawableInterface.o \
		src/Drawable1DInterface.o \
		src/Drawable2DInterface.o \
		src/Resizable2DInterface.o \
		src/Line.o \
		src/FilledRect.o \
		src/FramedRect.o \
		src/Font.o \
		src/Text.o \
		src/Image.o \
		src/imageutil/ImageUtil.o \
		src/imageutil/ImageUtil_png.o 

INCDIR =  
CFLAGS = -O2 -G0 -Wall -g 
CXXFLAGS = $(CFLAGS) -fexceptions -frtti
ASFLAGS = $(CFLAGS)

INCS = -I./header \
	   -I/usr/local/pspdev/include \
	   -I/usr/local/pspdev/psp/include \
	   -I/usr/local/pspdev/psp/include/c++/4.3.3 \
	   -I/usr/local/pspdev/psp/sdk/include 

CFLAGS := $(INCS)

LIBDIR =
LDFLAGS =

LIBS = -lintraFont -lpspgum -lpspgu -lpspvalloc -lpsprtc -lstdc++ -lm

include $(PSPSDK)/lib/build.mak
and i have intraFont installed through a custom makefile and as for the other intraFont functions they don't complain about it and the header file is correct and the library is correct because i made a lib makefile for intraFont 3.1 so why do i have this error
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

one more thing here is the makefile i made for intraFont in case anyone wants to use it

Code: Select all

#makefile for intraFont for PSP
#by kehon
PSPSDK=$(shell psp-config --pspsdk-path)
PSPDEV=$(shell psp-config --psp-prefix)
PSPBIN=$(PSPDEV)/bin
INSTALL_DIR=$(PSPDEV)/include/

TARGET_LIB = libintraFont.a
OBJS := intraFont.o libccc.o 

INCDIR =  
CFLAGS = -O2 -G0 -Wall -g 
CFLAGS += -I./include 
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =

LIBS = 

include $(PSPSDK)/lib/build.mak

install:
	@mkdir -p $(INSTALL_DIR)
	cp -f libccc.h $(INSTALL_DIR)
	cp -f intraFont.h $(INSTALL_DIR)
	@mkdir -p $(PSPDEV)/lib
	cp -f $(TARGET_LIB) $(PSPDEV)/lib
	@echo
	@echo "** Headerfiles installed in $(INSTALL_DIR)"
	@echo "** Library files installed in $(PSPDEV)/lib"
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Check which version of intraFont you're using... there have been BIG changes to intraFont that required changes to programs using intraFont.
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

J.F. wrote:Check which version of intraFont you're using... there have been BIG changes to intraFont that required changes to programs using intraFont.
i'm using 0.31 and i compiled with 0.31
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

What I meant was the functions themselves have changed - in name, function, etc, over time. You may be trying to use an "old" function that was eliminated or changed. Go through YOUR code and change it to use intraFont as it is NOW, not how it was X revisions ago.
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

this is my first time using intraFont so the functions i'm using are straight from the header file and included in there
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

why is it that oslib although not included in the makefile weighs in on a factor in this intratrafont is in pspdev/include/intrafont.h and also in pspdev/include/oslib/intrafont/intrafont.h why is it included first because its whats causing the compile error cause i update oslib and no problem except for the stuff that intraFont 0.30 doesnt have because i'm trying to use 0.31
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

That last post made no sense at all. :)

Don't try to turn intraFont into C++ if you don't know what you're doing in C++ (that's the errors in your first post - ignorance of C++ errors). Leave it as C and make sure it has those extern "C" {} in the h file.
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

J.F. wrote:That last post made no sense at all. :)

Don't try to turn intraFont into C++ if you don't know what you're doing in C++ (that's the errors in your first post - ignorance of C++ errors). Leave it as C and make sure it has those extern "C" {} in the h file.
wow um i didnt and they are externed it seems for some reason that instead of the compile using pspdev/psp/include/intrafont.h it is using pspdev/psp/include/oslib/intrafont/intrafont.h which oslib's intrafont is not as up to date as mine so when i updated oslibmod it worked except its still one version behind mine so i know how to fix it i just want to know why oslib's intrafont is being used instead of mine
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Sounds like you should try to separate the two. Maybe update the intraFont in OSLib and then quit using it separate from that. Seriously, this is why I hate C++. Even when you know what you're doing, it's a royal pain in the ass. I never write any on my own stuff in C++, and dislike working on C++ projects, though I can do it (like Basilisk II or DaedalusX64).
coolkehon
Posts: 355
Joined: Mon Oct 20, 2008 5:44 am

Post by coolkehon »

aha i found the problem it's not oslib directly (well sorta) in my Color class i included oslib because i had used the class a while ago and i removed the include now it works thats why oslib's intrafont overide mine
Post Reply