Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ Coding Magpi#66
#3
(10-29-2018, 07:35 AM)jomoengineer Wrote: I'm trying to follow along with these articles but ran into an issue with MagPi#66.

Where you describe adding the references to the libs in Code:Blocks, I was not able to locate the file names that are listed in the article.  I'm running a RasPi 3B+ with the latest Raspibian kernel 4.14.71-v7+.

This is what I found:
No GLESv2_static.a only libGLES_static.a
No EGL_static.a only libEGL_static.a
no vchiq_arm.a only libvchiq_arm.so
no vcos.a only libvcos.so


Also, when compiling the code (modified from MagPi #65) I get the following error:
-------------- Build: Debug in HelloWorld (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions -g -I../../../../../../opt/vc/include -I../../../../../../opt/vc/include/interface -I../../../../../../opt/vc/include/interface/vmcs_host/linux -I../../../../../../opt/vc/include/interface/vcos/pthreads -c /home/pi/development/MagPi/ed65/HelloWorld/SimpleObject.cpp -o obj/Debug/SimpleObject.o
g++  -o bin/Debug/HelloWorld obj/Debug/Game.o obj/Debug/main.o obj/Debug/OGL.o obj/Debug/SimpleObject.o   ../../../../../../opt/vc/lib/libbcm_host.so ../../../../../../opt/vc/lib/libGLESv2_static.a ../../../../../../opt/vc/lib/libEGL_static.a ../../../../../../opt/vc/lib/libkhrn_static.a ../../../../../../opt/vc/lib/libvchiq_arm.so ../../../../../../opt/vc/lib/libvcos.so
/usr/bin/ld: ../../../../../../opt/vc/lib/libEGL_static.a(khrn_client_platform_linux.c.o): undefined reference to symbol 'pthread_getspecific@@GLIBC_2.4'
//lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line

Oh, I got it.  I had to add -lpthread to the Other linker options.

the library names always start with libXXX 

we just refer to them without the lib in your project build options

take a look at this image attached to see how you set up the libs  and the other to see how you set up the search paths for the linker
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply


Messages In This Thread
C++ Coding Magpi#66 - by Brian Beuken - 01-26-2018, 04:37 PM
RE: C++ Coding Magpi#66 - by jomoengineer - 10-29-2018, 07:35 AM
RE: C++ Coding Magpi#66 - by Brian Beuken - 10-29-2018, 10:00 AM
RE: C++ Coding Magpi#66 - by Brian Beuken - 10-29-2018, 10:02 AM
RE: C++ Coding Magpi#66 - by jomoengineer - 10-29-2018, 03:41 PM
RE: C++ Coding Magpi#66 - by RobertG - 09-30-2020, 10:31 AM
RE: C++ Coding Magpi#66 - by Brian Beuken - 10-29-2018, 03:48 PM
RE: C++ Coding Magpi#66 - by jomoengineer - 10-30-2018, 06:53 AM
RE: C++ Coding Magpi#66 - by Brian Beuken - 10-30-2018, 08:32 AM
RE: C++ Coding Magpi#66 - by jomoengineer - 10-30-2018, 02:45 PM
RE: C++ Coding Magpi#66 - by Brian Beuken - 09-30-2020, 12:33 PM
RE: C++ Coding Magpi#66 - by RobertG - 10-01-2020, 01:34 PM
RE: C++ Coding Magpi#66 - by Brian Beuken - 10-01-2020, 06:41 PM
RE: C++ Coding Magpi#66 - by jomoengineer - 10-05-2020, 06:03 PM
RE: C++ Coding Magpi#66 - by Brian Beuken - 10-06-2020, 10:56 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)