ofxTwitter compile problem

I am on OSX Sierra 10.13.4 and I get compile error

“Invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)”

When I build the search ofxTwitter example. What have I donbe wrong/need
to do please? Is this obvious or more tricky?

I just want a simple as possible Twitter feed to run on OF. I have set
up my credentials.json file and registered on Twitter developer app etc.

Please can you help,

Many thanks,

James form UK

ofxTwitter is working and it has other addons as requirements and also requires openFrameworks 0.10+ (i.e. the master branch, a nightly build, etc). Please see the README for a full list.

Yes, I used the latest version, using git clone --recursive https://github.com/openframeworks/openFrameworks.git

I already followed the README for instructions, obtaining the dependencies via project generator.

Not sure why I have the issue…

Dear @bakercp
I installed many dependencies for ofxTwitter;
ofxAssimModelLoader
ofxGPS
ofxGeo
ofxHTTP
ofxIO
ofxMediaType
ofxNetwork
ofxNetworkUtils
ofxOAuth
ofxPoco
ofxSSLManager
ofxTwitter
and I still get the message <UIKit/UIKit.h> not found

  • not sure what other addons I need to run the Examples. Please can you clarify - I am on a Mac running High Sierra - with latest build of OF. Is there a script to download dependencies? I looked in the /Users/jtreg1/of2/openFrameworks/addons/ofxTwitter/scripts/osx folder
    and this was empty…
    thanks in advance

James

None of my addons require UIKit, so I’m not sure why that is coming up.

  • Are you generating your Xcode project files using the Project Generator app?
  • What version of Xcode are you using?

Hi Chris
Yes I am using project generator to create an empty project, copy over the /src files from the example in ofxTwitter, then add in the addins (I had to do them one at a time, working through sucessive compile attempts) - this may not be the best way but one that has worked (until now).
My version of XCode is 9.3 (9E145).
Thanks for your help…
James

I got it working!
I was so much in the mindset of create a new project, use project generator to add the addins then copy over the /src , then compile… wrong!

So I closed IDE, opened proj gen, imported your example, used the addins I listed above… updated it… opened in IDE - it compiled! then I copied over the resultant files into /apps/myapps/newDirectory … still works.

Thank you for your help Chris… I still would like advice on streamiling the addition of required addins… what is the workflow for that? I know you can read ofxTwitter.h to see the #include statements but it does not automate the process.

best wishes
James

Hi both,

Sorry to add another issue to this thread, but I am encountering errors when trying to use Chris’ ofxTwitter & suite of addons, which I would be eager to use for a project. I would have almost the same title were I to create another thread, so I hope it’s ok.

Contrary to James I am on Linux Mint 18.2 Sonya, and using QtCreator 4.4.1. I followed the instructions to upgrade to the Master branch, and successfully ran a few of the examples.

When it comes to ofxTwitter, however, this does not work. I use the examples provided in the add-on folder, update it using PG to include:

  • ofxGeo
  • ofxHTTP
  • ofxIO
  • ofxMediaType
  • ofxNetworksUtils
  • ofxPoco
  • ofxSSLManager
  • ofxTwitter

And when I try to build it, something occurs, it seems, in the poco library:

/usr/bin/ld: /home/default/bin/OpenFrameworks/addons/ofxPoco/libs/poco/lib/linux64/libPocoNetSSL.a(Context.o): undefined reference to symbol 'SSL_CTX_get_timeout@@OPENSSL_1.0.0'
//lib/x86_64-linux-gnu/libssl.so.1.0.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Process failed with exit code 1.
The following products could not be built for configuration qtc_Desktop_32d7cc84-debug:
	example_basic_rest_search
Error while building/deploying project example_basic_rest_search (kit: Desktop)
The kit Desktop has configuration issues which might be the root cause for this problem.
When executing step "Qbs Build"

My current guesses:

  • The kit Desktop on QtCreator does not seem to cause problems with the examples I ran earlier today. However, given that I encountered issues when transitioning to the Master branch due to QtCreator versions, there might be something there I don’t know about.
  • Tried to look for the ‘undefined reference symbol’ and the ‘DSO’ problems on StackOverflow, and found related issues, around the linking of libraries, and the order in which those are called, as well as flags, all of which are still beyond my current knowledge. I feel like there is something obvious I am missing, either in the configuration of OF or QtCreator (or even maybe the Python version used? I think somebody had a reference problem because of Anaconda being installed, instead of python 2.7), but I can’t figure out what this could be.

I also tried to build it it from the command line (which was what had led me to realise that my QtCreator version was the wrong one), but the ‘make’ command also gives me an error:

HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libcurl glfw3 libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
Compiling OF library for Release
make[1]: Entering directory '/home/default/bin/OpenFrameworks/libs/openFrameworksCompiled/project'
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libcurl glfw3 libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libcurl glfw3 libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libcurl glfw3 libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
Done!
make[1]: Leaving directory '/home/default/bin/OpenFrameworks/libs/openFrameworksCompiled/project'


Compiling ofxOffenceMechanism for Release
make[1]: Entering directory '/home/default/bin/OpenFrameworks/apps/myApps/ofxOffenceMechanism'
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libcurl glfw3 libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
/home/default/bin/OpenFrameworks/libs/openFrameworksCompiled/project/makefileCommon/config.addons.mk:210: *** missing separator. Stop.
make[1]: Leaving directory '/home/default/bin/OpenFrameworks/apps/myApps/ofxOffenceMechanism'
/home/default/bin/OpenFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:124: recipe for target 'Release' failed
make: *** [Release] Error 2

When running the same command on an empty sketch produced with the PG everything works fine.

Any insight would be most welcome, thanks for reading!
Best,
Jeremie

Update

Please ignore the last block of errors! A simple modification of the OF_ROOT path in the Makefile did the trick.

So, I can confirm that the issue comes from QtCreator. The ‘make’ command allowed me to compile and run the example_basic_search.

It might be because I attempt to keep two versions of QtCreator in parallel (4.1 and 4.4.1, respectively for the stable and for the master branches)? I did run the QtCreator script when I installed the master branch, however.

Thanks again for reading, it would definitely be great to be able to keep using the QtCreator IDE, which is great.

can you edit the addon_config.mk in addons at line 83 inside the config for linux64 add:

	ADDON_LDFLAGS = -lssl

or

	ADDON_LDFLAGS = -lopenssl

so that whole section looks like:

linux64:
	ADDON_LIBS = libs/poco/lib/linux64/libPocoNetSSL.a
	ADDON_LIBS += libs/poco/lib/linux64/libPocoNet.a
	ADDON_LIBS += libs/poco/lib/linux64/libPocoCrypto.a
	ADDON_LIBS += libs/poco/lib/linux64/libPocoUtil.a
	ADDON_LIBS += libs/poco/lib/linux64/libPocoJSON.a
	ADDON_LIBS += libs/poco/lib/linux64/libPocoXML.a
	ADDON_LIBS += libs/poco/lib/linux64/libPocoFoundation.a
	ADDON_LDFLAGS = -lssl

That’s what the project generator is for – you create a new project and list the addons you want. When you want to update a project with more addons, you just update the project folder with Project generator and add a list of addons.

Thanks for the answer!

I tried the addition you suggested in the addon_config.mk found in the ofxPoco addon, the only one I could find that had these lines.

The first option seems to stumble on another element in the libs, the error remaining quite similar:

/usr/bin/ld: /home/default/bin/OpenFrameworks/addons/ofxPoco/libs/poco/lib/linux64/libPocoNetSSL.a(SecureStreamSocketImpl.o): undefined reference to symbol 'X509_free@@OPENSSL_1.0.0'
//lib/x86_64-linux-gnu/libcrypto.so.1.0.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

And the second yields something else entirely I’m afraid:

:-1: error: cannot find -lopenssl
:-1: error: collect2: error: ld returned 1 exit status

can you add also after the previous line:

ADDON_LDFLAGS += -lcrypto

Amazing, it works! Thanks so much!

I also found this SO page that gives some info about linking libraries, it makes sense!