ofXOAuth, ofXTwitter library issues

Hello OF People!

I am trying to use ofXTwitter in OF 0.8.0. It is dependent on ofXJSON and ofXAuth (as well as ofXMLSettings).
When compiling a project generated with the Project Generator including all these addons, the build fails when compiling the ofXAuth files. It says it cannot find [sys/socket.h]

Does this addon not work on windows / code::blocks? I tried adding the libraries used by the addons to the search paths but it didn’t work.
Adding the [socket.h] file manually (I do have a header file named like that in my POCO libraries) just generates loads of new problems (undefined curl definitions)…

Anyone any clues if this can be fixed - or any working Code::Blocks ofXTwitter examples? :slight_smile:

Hi @inoodle unfortunately https://github.com/bakercp/ofxOAuth/tree/master/libs/liboauth/lib does not currently include support for mingw / codeblocks (or visual studio for that matter).

I compiled all of the libs with http://liboauth.sourceforge.net/ v 1.0.1 if you wanted to try to generate the static libraries for codeblocks.

If you just need basic twitter support, you can skip ofxOAuth and use Poco directly.

You’ll have to adapt this example for your needs, but it has worked for me across platforms.

https://github.com/pocoproject/poco/tree/develop/Net/samples/TwitterClient/src

Hi @bakercp
Many thanks for your reply! Going through some of the header files, I already got the impression the files were not optimized for windows.

I only need basic access to Twitter´s Search API (part of their REST API, I believe) for a small project on data visualization - so I will try and work with the example you linked to.

I do hope that if you (or anyone else) has time, ofXOAuth will one day be updated to work cross-platform, it seems very useful :smile: ! I may try and recompile it myself - but my C++ skills are limited at best…

I probably won’t update ofxOAuth, but my upcoming ofxTwitterTools (it’s not released yet) just uses ofxHTTP without any third party libraries (besides Poco, which is in the core) which will be cross platform automatically. Keep an eye open for it.

1 Like

I like the sound of that :wink:
Dependencies on 3rd party libraries always cause trouble - and often sooner rather then later :smile:

I will keep a very close eye out for that!