Homebrew Failing to compile with FreeTypeGX

loco365

Well-Known Member
OP
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927
So I decided to learn some programming languages as a New Years resolution and I decided to start by using DevKitPro. I am writing a small piece of code and I wanted to use more than just printf commands as you can't do that much with them, so I found FreeTypeGX. I am having the same issue as stated in this thread and I see what is wrong (It's a C++ header and my project is in C). But, I want to extend on that and try to solve that issue. Would I have to convert my project to C++, or is it possible to get a C header for it?

If you need it, here is my makefile process:


Code:
> "make"
pokemondp.ttf
bin2s -a 32 /c/Wii/project1/data/pokemondp.ttf | powerpc-eabi-as -o pokemondp.ttf.o
echo "extern const u8" `(echo pokemondp.ttf | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo pokemondp.ttf | tr . _)`.h
echo "extern const u8" `(echo pokemondp.ttf | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo pokemondp.ttf | tr . _)`.h
echo "extern const u32" `(echo pokemondp.ttf | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo pokemondp.ttf | tr . _)`.h
template.c
In file included from c:/Wii/project1/source/template.c:7:0:
c:/devkitPro/libogc/include/Metaphrasis.h:103:1: error: unknown type name 'class'
c:/devkitPro/libogc/include/Metaphrasis.h:103:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
In file included from c:/Wii/project1/source/template.c:8:0:
c:/devkitPro/libogc/include/FreeTypeGX.h:150:15: fatal error: map: No such file or directory
compilation terminated.
make[1]: *** [template.o] Error 1
"make": *** [build] Error 2

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

Note: I have a similar thread on the WiiBrew forums, but since this place is far more active, I thought it'd be better to also post it here as I'd be more likely to get a response that I can work with.
 

tueidj

I R Expert
Member
Joined
Jan 8, 2009
Messages
2,569
Trophies
0
Website
Visit site
XP
999
Country
Try renaming your template.c file to template.cpp. That way the C++ compiler will be used (it can build plain C code fine) and it shouldn't complain about the C++ headers.
 

loco365

Well-Known Member
OP
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927
Try renaming your template.c file to template.cpp. That way the C++ compiler will be used (it can build plain C code fine) and it shouldn't complain about the C++ headers.
Ok. I'll give that a try and see what it does.

Ok. Now I have only one error after correcting my makefile.

Code:
> "make" 
pokemondp.ttf
bin2s -a 32 /c/Wii/project1/data/pokemondp.ttf | powerpc-eabi-as -o pokemondp.ttf.o
echo "extern const u8" `(echo pokemondp.ttf | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo pokemondp.ttf | tr . _)`.h
echo "extern const u8" `(echo pokemondp.ttf | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo pokemondp.ttf | tr . _)`.h
echo "extern const u32" `(echo pokemondp.ttf | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo pokemondp.ttf | tr . _)`.h
template.cpp
c:/Wii/project1/source/template.cpp:9:27: fatal error: pokemondp.ttf.h: No such file or directory
compilation terminated.
make[1]: *** [template.o] Error 1
"make": *** [build] Error 2

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

I guess I need to fix something? How do I get the font as a .h file?
 

loco365

Well-Known Member
OP
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927
It's just a typo. You should be using "pokemondp_ttf.h" instead.
Thanks for all the help. It's helping, but it produces more and more errors. I think it even wanted me to get rid of the code that inits the GC pad. But, I have tried to just simply clear all the errors. All that now remains between me and a usable file is:

Code:
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.6.1/../../../../powerpc-eabi/bin/ld.exe: cannot find -lftimage
If I get lftimage, I should be able to compile. I don't know why this code has so many issues...

And where is lftimage? :confused:
 

loco365

Well-Known Member
OP
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927
I'm still curious as to lftimage and where I can get it. I've searched Google and the only result I can get that I can work with is this thread. And it's already helped me.
 

loco365

Well-Known Member
OP
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927
Awesome. None of those pages appeared on Google results. >_> After rebooting to... uggh... Vista... *shudder*, I added it, but I get the same error. Does ld.exe look in a specific directory for it or does it look all over the devkitpro folder (or libogc for that matter)? I don't know if it's Vista's fault or it's just my code so far. And it's getting the best of me.
 

loco365

Well-Known Member
OP
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927
I still haven't had luck getting it to work. Is there a specific directory it's supposed to be in? It's currently in C:/devkitpro/libogc/lib.

My own computer hates me...
 

loco365

Well-Known Member
OP
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927
So I've pulled out FreeTypeGX and work with libgme for now until I can get it working. Is there any kind of documentation on libgme?

I get this constantly:

Code:
> "make" 
make[1]: *** No rule to make target `Undake30beta.spc.o', needed by `/c/Wii/project1.elf'.  Stop.
"make": *** [build] Error 2

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

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Xdqwerty @ Xdqwerty: See ya see ya later later