Building for android: problems with Poco


I am trying to build an openframeworks application for android and I am having multiple problems with Poco. This is the last error I have:

error: no matching function for call to 'std::unique_lock<std::mutex>::unique_lock(Poco::FastMutex&)'
         ofScopedLock lock(_mutex);

How could I fix this?
I also believe that there is something wrong with my poco linking because I’ve been having a lots of problems related to poco, what can I do to solve it?


in 0.9 we’ve changed ofMutex from using poco fastmutex to std::mutex and ofScopedLock from poco scopedlock to std::unique_lock ofMutex and ofScopedLock should be deprecated but there’s no way to do it yet in visual studio and some old versions of gcc and clang so we’ve left them there by now.

It seems you might be using Poco::FastMutex directly in your code, which will fail when combined with unique_lock, you should change any appeareance of that to std::mutex

Thanks for your answer Arturo.

This particular error is in the line 372 of the file ofxHTTP/libs/ofxHTTP/src/WebSocketConnection.cpp , which is the first line in this function:

std::size_t WebSocketConnection::getTotalBytesSent() const
    ofScopedLock lock(_mutex);
    return _totalBytesSent;

I have not written this function, as is part of ofxHTTP, so I am not sure if I should change it or not.

The develop branch of ofxHTTP and my other addons should be updated for 090 if not I welcome any pull requests!

I have just hard pulled the entire openframeworks repository and I do not have the same error again, but the error I have is still related to poco:

In file included from /Library/openFrameworks/libs/openFrameworks/types/ofBaseTypes.h:5:0,
                 from /Library/openFrameworks/libs/openFrameworks/gl/ofTexture.h:5,
                 from /Library/openFrameworks/libs/openFrameworks/graphics/ofImage.h:4,
                 from /Library/openFrameworks/addons/ofxMaps/libs/ofxMaps/includes/ofx/Maps/Tile.h:30,
                 from /Library/openFrameworks/addons/ofxMaps/libs/ofxMaps/includes/ofx/Maps/AbstractMapTypes.h:30,
                 from /Library/openFrameworks/addons/ofxMaps/libs/ofxMaps/includes/ofx/Maps/BaseTileProvider.h:31,
                 from /Library/openFrameworks/addons/ofxMaps/libs/ofxMaps/includes/ofx/Maps/BaseURITileProvider.h:35,
                 from /Library/openFrameworks/addons/ofxMaps/libs/ofxMaps/src/BaseMapBoxTileProvider.cpp:26:
/Library/openFrameworks/libs/poco/include/Poco/FPEnvironment_C99.h: In static member function 'static bool Poco::FPEnvironmentImpl::isNaNImpl(float)':
/Library/openFrameworks/libs/openFrameworks/math/ofMatrix4x4.h:674:18: error: expected unqualified-id before '(' token
 #define isnan(a) ((a) != (a))

What can I do?

It is solved. I needed the addon ofxNetworkUtils. Thanks