Raspberry Pi and loauth and lcurl - ofxOAuth - ofxTwitter

Hi,
I am trying to run an OF app on Raspberry Pi.
This app works with different addons
ofxOAuth ( this specific branch)
ofxJSON
ofxXmlSettings
ofxTwitter

It works perfectly on my computer (OSX) but I have these errors when I try tu make the file on RPi.

/usr/bin/ld: cannot find -loauth
/usr/bin/ld: cannot find -lcurl

../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:296: recipe for target 'bin/Tweet_Rpi' failed
make[1]: *** [bin/Tweet_Rpi] Error 1
make[1]: Leaving directory '/home/pi/openFrameworks/apps/myApps/Tweet_Rpi'
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:126: recipe for target 'Release' failed
make: *** [Release] Error 2

I have no idea on how to sort this out.
I followed a previous thread

but with no results.
Anyone any help please?

cheers

1 Like

First, the ofxOAuth branch you are using does not include the binaries for oauth for armv6. They are in my original ofxOAuth branch though. You should be able to copy and paste if you need to use that specific branch. Second, you’ll need to install libcurl using apt-get like

sudo apt-get install curl

You may need to install libcurl rather than curl I can’t recall … and unfortunately I don’t have a Pi available at the moment.

1 Like

Thanks @bakercp!
I will try this first thing in the morning.
I hope this will sort the things out!

Ah, one more thing, the addons_config.mk file in the branch you are using is also out of date and not compatible with the Raspberry Pi. The one in the main branch is. I’m not sure what changes were made in that branch, so unless there’s a specific reason to use it, I’d recommend my branch, as I’ve tested it w/ the Pi. If there is a feature in the other branch that could be integrated into my original repo, I’d be happy to consider a PR.

I am using that branch as apparently is the only one that works with ofxTwitter. At least the only one I managed to make it work.
This happens on OSx though.
Tomorrow I will try all of your suggestions in RPi and I will let you know.
p.s.
I used your most recent ofxOAuth some days ago but I always get this error

[verbose] ofxOAuth::post: HTTP post request failed.

The alternative branch combined with ofxTwitter sorted my problem out.

thanks!

HI @bakercp,
I tried all the things you said.
I installed curl and the installation was ok. I tried libcurl and I got error message. I found out I had to install a specific package.

sudo apt-get install libcurl4-openssl-dev

installation went ok.
Then I tried your options:

  1. I copied the arm libraries from your latest ofxOAuth into the folder of the alternative ofxOAuth branch. I make the app and this is what I get

    /usr/bin/ld: cannot find -loauth
    collect2: ld returned 1 exit status
    …/…/…/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:296: recipe for target ‘bin/Tweet_Rpi’ failed
    make1: *** [bin/Tweet_Rpi] Error 1
    make1: Leaving directory ‘/home/pi/openFrameworks/apps/myApps/Tweet_Rpi’
    …/…/…/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:126: recipe for target ‘Release’ failed
    make: *** [Release] Error 2

2)I then copied the addons_config.mk file and substituted that to the alternative branche and this is the error that I get:

/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/Tweet_Rpi' failed
make[1]: *** [bin/Tweet_Rpi] Error 1
make[1]: Leaving directory '/home/pi/openFrameworks/apps/myApps/Tweet_Rpi'
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:126: recipe for target 'Release' failed
make: *** [Release] Error 2
  1. I then tried to use directly your ofxOAuth but I get the same message above

This message looked like a previous post i was reading and I tried the suggestion by @arturo

    PLATFORM_LDFLAGS += -pthread 

    PLATFORM_LIBRARIES += pcre
    PLATFORM_LIBRARIES += rt 
    PLATFORM_LIBRARIES += X11 
    PLATFORM_LIBRARIES += dl 

all these lines are already in my config file but the first line.

I added the first line but I get a new error that the

/usr/bin/ld: cannot find -l-pthread

I looked it up if I could install pthread but I don’ even get what exactly that is and if I really need that.

So, at the moment I feel like I am floating in the darkness…
DO you have any idea of what is going on?

many thanks!

1 Like

the bad news is tha tI can’t even make other apps that were working before. I get the same error message now

/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/myApp' failed
make[1]: *** [bin/myApp] Error 1
make[1]: Leaving directory '/home/pi/openFrameworks/apps/myApps/myApp'
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:126: recipe for target 'Release' failed
make: *** [Release] Error 2

take off the -

so
PLATFORM_LDFLAGS += -pthread
to
PLATFORM_LDFLAGS += pthread

I think you can remove the whole pthread line actually as I bet it is already included

Oh yeah!
yes!! the problem was axactly the missing line
I didn’t have

PLATFORM_LDFLAGS += pthread

Guys, thank you so much!!
I hope this might be of some help for other people.
It definitely was for me.

thanks again!!
:smile:

1 Like

I ran into this problem as well, while using the main @bakercp branch of ofxOAuth and openFrameworks 0.8.4 (armv6) with an older Raspberry Pi 1 (Model B). All I needed to do was install the Libcurl mentioned above to get it to compile. (Didn’t need the flags).

Thanks @antocreo for posting it!

1 Like