oF compilation errors on raspberry pi

I tried to do the same install 3 times and still get some compilation errors when compiling an example, some help would be really useful.

/usr/bin/ld: ../../../libs/openFrameworksCompiled/lib/linuxarmv6l/libopenFrameworks.a(ofUtils.o): undefined reference to symbol 'clock_gettime@@GLIBC_2.4'
//lib/arm-linux-gnueabihf/librt.so.1: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:296: recipe for target 'bin/polygonExample' failed
make[1]: *** [bin/polygonExample] Error 1
make[1]: Leaving directory '/home/pi/openFrameworks/examples/graphics/polygonExample'
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:126: recipe for target 'Release' failed
make: *** [Release] Error 2

could it come from a bad dependencies install?

try updating the system to the latest version using rpi-update and then

sudo apt-get update
sudo apt-get dist-upgrade

No luck. Still the same error…

There was an error in the install_dependencies.sh with the gtk library
gtk2 is called libgtk2.0-dev while gtk3 libgtk-3-dev …

but tried to re-compile oF and no effect

can you change in ofUtils.cpp near line 88:

unsigned long long ofGetSystemTime( ) {
    #if defined(TARGET_LINUX)

and

unsigned long long ofGetSystemTimeMicros( ) {
    #if defined(TARGET_LINUX)

with:

unsigned long long ofGetSystemTime( ) {
    #if 0

and

unsigned long long ofGetSystemTimeMicros( ) {
    #if 0

Still some issues but this time from ofVbo…

/usr/bin/ld: ../../../libs/openFrameworksCompiled/lib/linuxarmv6l/libopenFrameworks.a(ofVbo.o): undefined reference to symbol 'dlsym@@GLIBC_2.4'

//lib/arm-linux-gnueabihf/libdl.so.2: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
…/…/…/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:296: recipe for target ‘bin/graphicsExample’ failed
make[1]: *** [bin/graphicsExample] Error 1
make[1]: Leaving directory ‘/home/pi/openFrameworks/examples/graphics/graphicsExample’
…/…/…/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:126: recipe for target ‘Release’ failed
make: *** [Release] Error 2

not sure what’s going on i’ve been using the raspberry for a while this week and haven’t had any trouble, anyway can you add in libs/openFrameworksCompiled/projects/linuxarmv6l/config.linux.armv6l.default.mk around line 135, after the other definition for platform libraries:

PLATFORM_LIBRARIES += dl

Well still some problems.
I start to think that it comes from the pi itself.
I’ll try with another reaspberry pi.
But thanks a lot for your help.

what error are you getting now? i’ve been cross compiling from the computer and i suspect everyone who maintains the rapsberry does the same so it might be because of that.

I’ve got exactly the same problems here - practically in real-time!

Just recompile now with the PLATFORM_LIBRARIES set - will let you know how that goes!

Dave

I’ve been trying this set up which is definitely much faster!

It worked well with the rpi / NFS boot / VM machine on mac osx
I could launch build some examples without problems,
but i was completely lost when it came to create a standalone SD card in the end…
(I get that you need copy the image but the part with modifying the boot and root partition is like chinese for me…)

I’m trying to compile the graphicsExample via ssh on mac osx and now get this error:

/usr/bin/ld: ../../../libs/poco/lib/linuxarmv6l/libPocoFoundation.a(Thread.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
collect2: ld returned 1 exit status
…/…/…/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:296: recipe for target ‘bin/graphicsExample’ failed
make[1]: *** [bin/graphicsExample] Error 1
make[1]: Leaving directory ‘/home/pi/openFrameworks/examples/graphics/graphicsExample’
…/…/…/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:126: recipe for target ‘Release’ failed
make: *** [Release] Error 2

it seems like some flags that i added for cross compiling are now needed for normal compiling, can you try to add this after the last flag you added in the config file:

    PLATFORM_LDFLAGS += -pthread 
    
    PLATFORM_LIBRARIES += pcre
    PLATFORM_LIBRARIES += rt 
    PLATFORM_LIBRARIES += X11 
    PLATFORM_LIBRARIES += dl

you might already have dl but just in case

1 Like

It works!
Thanks a lot!

this looks awesome and how I used to do embedded development!

I’m afraid I get the same error (latest distribution, B+) even with the extra PLATFORM_LIBRARIES and PLATFORM_LDFLAGS

I’ve been trying the rpi-build-and-boot route instead - the PI doesn’t seem to be finding the nfs - do I need to explicitly run playbook.yml?

D

Had exactly the same issue but adding
the flags from Arturo’s last post did the trick.

So big thanks for this!

I had the same problem with of 0.8.4 (undefined reference to symbol ‘tan@@GLIBC_2.4’)

It turned out i had CXX defined in my environment which was messing things up.
unsetting it helped and i could compile:

unset CXX

Hi, where did you set this?

@antocreo

it would be from the command line

$ unset CXX

if you want to know if it is set to something

$ echo $CXX