g8gkq
Posts: 11
Joined: Thu Mar 30, 2017 10:25 am
Location: Southampton

No OpenVG in Raspbian Stretch Lite? Solved

Wed Oct 11, 2017 7:35 pm

I (and about 200 others) have been using OpenVG graphics on a headless RPi running Jessie Lite with a touchscreen to control a Digital Amateur Television Transmitter for a year or so. We realise that sooner or later we are going to have to migrate to Stretch and I have started testing.

I can't seem to find the components that I need for OpenVG in either the Desktop or Lite versions of Stretch (we will end up using the Lite version). One cause of the problem appears to be that libOpenVG.so and a number of other files are not included in /opt/vc/lib/. This means that when I come to compile I get errors such as :

Code: Select all

libshapes.o: In function `loadfont':
libshapes.c:(.text+0x1c0): undefined reference to `vgCreatePath'
libshapes.c:(.text+0x1e4): undefined reference to `vgAppendPathData'
I have already changed the makefile to use -lbrcmEGL -lbrcmGLESv2 rather than -lEGL and -lGLESv2

Is there a package that I can load to install the OpenVG library files? Or am I missing something else obvious?

Thanks for any suggestions

Dave
Project Lead for the Portsdown DATV Transmitter: https://github.com/BritishAmateurTelevisionClub/rpidatv
Last edited by g8gkq on Wed Oct 11, 2017 9:35 pm, edited 1 time in total.

User avatar
topguy
Posts: 3504
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: No OpenVG in Raspbian Stretch Lite?

Wed Oct 11, 2017 8:18 pm

Small tips on how to solve similar problems...

Step 1: Which header file defines the function we are missing ?

Code: Select all

pi@raspberrypi:/ $ cd /opt/vc/include/
pi@raspberrypi:/opt/vc/include $ rgrep vgCreatePath .
./VG/openvg.h:VG_API_CALL VGPath VG_API_ENTRY vgCreatePath(VGint pathFormat,
pi@raspberrypi:/opt/vc/include $
Ok, so "openvg.h" it is..

Step 2: Which library file can be suitable ?

Code: Select all

pi@raspberrypi:/opt/vc/include $ cd /opt/vc/lib/
pi@raspberrypi:/opt/vc/lib $ ls
libbcm_host.so    libdebug_sym.so        libGLESv1_CM.so        libmmal_core.so       libvcfiled_check.a  libWFC.so
libbrcmEGL.so     libdebug_sym_static.a  libGLESv2.so           libmmal.so            libvchiq_arm.so     plugins
libbrcmGLESv2.so  libdtovl.so            libGLESv2_static.a     libmmal_util.so       libvchostif.a
libbrcmOpenVG.so  libEGL.so              libkhrn_client.a       libmmal_vc_client.so  libvcilcs.a
libbrcmWFC.so     libEGL_static.a        libkhrn_static.a       libopenmaxil.so       libvcos.so
libcontainers.so  libelftoolchain.so     libmmal_components.so  libOpenVG.so          libvcsm.so
hmm.. this libOpenVG looks promising considering the name of the headerfile...

Step 3 : Can we check which functions are in a library ?

Yes we can.

Code: Select all

pi@raspberrypi:/opt/vc/lib $ nm libOpenVG.so | grep vgCreatePath
00008ac0 T vgCreatePath
So I would make sure that "-L/opt/vc/lib -lOpenVG" is part of my compiler options.

Also tip if you are unsure which package a file belongs to:

Code: Select all

pi@raspberrypi:/opt/vc/lib $ dpkg -S libOpenVG.so
libraspberrypi0: /opt/vc/lib/libOpenVG.so
pi@raspberrypi:/opt/vc/lib $ dpkg -l | grep libraspberrypi0
ii  libraspberrypi0                1.20170703-1                      armhf        EGL/GLES/OpenVG/etc. libraries for the Raspberry Pi's VideoCore IV

g8gkq
Posts: 11
Joined: Thu Mar 30, 2017 10:25 am
Location: Southampton

Re: No OpenVG in Raspbian Stretch Lite? Solved

Wed Oct 11, 2017 9:34 pm

@topguy Thanks very much - you led me to the solution:

libOpenVG.so is not included in Raspbian Stretch, but I did notice a file called libbrcmOpenVG.so in /opt/vc/lib. Running:

Code: Select all

pi@raspberrypi:/opt/vc/lib $ nm libbrcmOpenVG.so | grep vgCreatePath
00008ac8 T vgCreatePath
showed that this file was promising.

In another post, I found that someone had solved a similar issue by creating a symlink of /usr/lib/arm-linux-gnueabihf/libOpenVG.so to this file. So I ran

Code: Select all

pi@raspberrypi:/usr/lib/arm-linux-gnueabihf $ sudo ln -s /opt/vc/lib/libbrcmOpenVG.so libOpenVG.so
.
I also changed all the lines in my makefile that read

Code: Select all

LIBFLAGS=-L/opt/vc/lib -lEGL -lGLESv2 -ljpeg
to

Code: Select all

LIBFLAGS=-L/opt/vc/lib -lbrcmEGL -lbrcmGLESv2 -ljpeg
With those changes, the compile ran without errors and the touchscreen OpenVG graphics are now working.

Thanks again

Dave

User avatar
topguy
Posts: 3504
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: No OpenVG in Raspbian Stretch Lite? Solved

Thu Oct 12, 2017 9:59 am

I was pretty sure I was running on Raspbian Stretch Lite too and when I look back at my I see I have both "libbrcmOpenVG.so" and "libOpenVG.so" in the directory. So I had already made that symlink at some point but just didn't realise it.

g8gkq
Posts: 11
Joined: Thu Mar 30, 2017 10:25 am
Location: Southampton

Re: No OpenVG in Raspbian Stretch Lite? Solved

Thu Oct 12, 2017 4:18 pm

Thanks

Is your symlink in the /opt/vc/lib/ folder or the /usr/lib/arm-linux-gnueabihf folder?

Dave

User avatar
topguy
Posts: 3504
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: No OpenVG in Raspbian Stretch Lite? Solved

Fri Oct 13, 2017 2:13 pm

NO links to anything in "/usr/lib/arm-linux-gnueabihf" from "/opt/vc", that will very quickly break stuff. (IMO)
Its also possibly the reason they renamed the libs to include "brcm" because it caused confusion with duplicate named Mesa libraries.

g8gkq
Posts: 11
Joined: Thu Mar 30, 2017 10:25 am
Location: Southampton

Re: No OpenVG in Raspbian Stretch Lite? Solved

Fri Oct 13, 2017 2:21 pm

Thanks! I'll change it.

Dave

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 37 guests