Page 1 of 1
"hello" example problems
Posted: Sun Jun 24, 2012 2:31 pm
by Method
I'm having trouble compiling the examples that came with the system. For example, hello font, when I compile it using geany, it returns:
Code: Select all
main.c29:22 fatal error: bcm_host.h: No much file or directory
It's having a paddy over the
Any help at all?
Re: "hello" example problems
Posted: Sun Jun 24, 2012 3:18 pm
by RichardUK
Which distro you using?
Are you building on the RPi?
Re: "hello" example problems
Posted: Sun Jun 24, 2012 3:36 pm
by dom
You need to compile it using the makefile.
E.g type in make in the directory.
I'd imagine it is possible to configure Geany to execute the make command, but I've never tried.
Re: "hello" example problems
Posted: Sun Jun 24, 2012 3:40 pm
by gregeric
I've found that if I load the makefile into geany then I can invoke make, or make custom, from the geany menus.
Re: "hello" example problems
Posted: Sun Jun 24, 2012 3:47 pm
by RichardUK
I've just tried it and there is an error in the make file. The path to the libfreetype.so is wrong, remove "arm-linux-gnueabi" from the path. After that it built and ran ok from the terminal.
Re: "hello" example problems
Posted: Sun Jun 24, 2012 3:51 pm
by Method
RichardUK wrote:I've just tried it and there is an error in the make file. The path to the libfreetype.so is wrong, remove "arm-linux-gnueabi" from the path. After that it built and ran ok from the terminal.
I don't quite understand, how do I build and then run it from the terminal?
Re: "hello" example problems
Posted: Sun Jun 24, 2012 4:18 pm
by RichardUK
When the system had booted and you have logged on you need to cd to the folder.
Code: Select all
cd /opt/vc/src/hello_pi/hello_font
Then you need to edit the make file.
delete the line "arm-linux-gnueabi" Should look like the following
Code: Select all
OBJS=main.o
BIN=hello_font.bin
LDFLAGS+=../libs/vgfont/libvgfont.a -L$(SDKSTAGE)/usr/lib $(SDKSTAGE)/usr/lib/libfreetype.so -lz
include ../Makefile.include
Then just type make
After that run it with ./hello_font.bin
Hopefully I have explained that ok.
Re: "hello" example problems
Posted: Sun Jun 24, 2012 4:31 pm
by Method
Make didn't work.
Code: Select all
cc: error: /usr/lib/libfreetype.so: No such file or directory
make: *** [hello_font.bin] Error 1
rm main.o
Re: "hello" example problems
Posted: Sun Jun 24, 2012 4:41 pm
by dom
Possibly:
sudo apt-get install libfreetype-dev
Re: "hello" example problems
Posted: Sun Jun 24, 2012 4:48 pm
by Method
Doesn't like that, I'm afraid.
Code: Select all
E: Invalid operation libfreetype-dev
Re: "hello" example problems
Posted: Sun Jun 24, 2012 4:55 pm
by dom
Actually I think it is:
sudo apt-get install libfreetype6-dev
although your error message didn't look right. Are you sure you typed it correctly?
Re: "hello" example problems
Posted: Sun Jun 24, 2012 5:29 pm
by RichardUK
I had that error, sorry, forgot to say I had installed libfreetype6-dev. Doh! I knew I had forgotten something, too busy writing my texture code.

Re: "hello" example problems
Posted: Mon Jun 25, 2012 10:47 am
by Method
Most odd. When I tried to install libfreetype6 nothing updated or changed.
Code: Select all
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded
I tried making again and it came up with the same error, no such file or directory. I checked in that directory and libfreetype.so doesn't exist in /usr/lib/
Heh, what now.
Re: "hello" example problems
Posted: Mon Jun 25, 2012 11:06 am
by dom
Are you on Squeeze or Wheezy ? On Wheezy the file is here:
/usr/lib/arm-linux-gnueabi/libfreetype.so
Re: "hello" example problems
Posted: Mon Jun 25, 2012 12:20 pm
by jmacey
if you are in the /opt/vc/src/hello_pi directory it is owned by root, so you either need to do a sudo make or preferably copy the directory to you home and edit the make files to the correct place.
Re: "hello" example problems
Posted: Mon Jun 25, 2012 8:17 pm
by RichardUK
Which distro you using?
Re: "hello" example problems
Posted: Wed Jun 27, 2012 3:27 pm
by Method
RichardUK wrote:Which distro you using?
Squeeze, and I changed the directory as per:
dom wrote:Are you on Squeeze or Wheezy ? On Wheezy the file is here:
/usr/lib/arm-linux-gnueabi/libfreetype.so
In the make file; so that's nice, and that worked. It still has a problem over the line:
I feel like a proper twerp for going on, and I bet it's just me that's managed to do something silly.
Re: "hello" example problems
Posted: Sat Jun 30, 2012 5:52 pm
by RichardUK
Sorry didn't get back to you sooner, been working away with some very expensive robots.
So, lets recap. You have created a bootable Debian Squeeze sd card. Booted it and changed directory to this example project. Typed make and you get this error?
I'll do the same and see if I can recreate the issue, my Squeeze has got the driver update and a few other installs so may not be a good system for me to try to help you with.