POCO HTTP Client undefined reference


I’m trying to use POCO’s httpget.cpp example to work within openframeworks but for some reason the build is failing (see attachment).

In my SceneMaster.h I have among other things the following;

#include "Poco/Net/HTTPClientSession.h"  
#include "Poco/Net/HTTPRequest.h"  
#include "Poco/Net/HTTPResponse.h"  
#include "Poco/StreamCopier.h"  
#include "Poco/Path.h"  
#include "Poco/URI.h"  
#include "Poco/Exception.h"  
#include <iostream>  
using Poco::Net::HTTPClientSession;  
using Poco::Net::HTTPRequest;  
using Poco::Net::HTTPResponse;  
using Poco::Net::HTTPMessage;  
using Poco::StreamCopier;  
using Poco::Path;  
using Poco::URI;  
using Poco::Exception;  

And in SceneMaster.cpp I am doing the following;

URI uri("["]("));  
std::string path(uri.getPathAndQuery());  
if (path.empty()) path = "/";  
HTTPClientSession session(uri.getHost(), uri.getPort());  
HTTPRequest req(HTTPRequest::HTTP_GET, path, HTTPMessage::HTTP_1_1);  
HTTPResponse res;  
std::istream& rs = session.receiveResponse(res);  
std::cout << res.getStatus() << " " << res.getReason() << std::endl;  
StreamCopier::copyStream(rs, std::cout);  

When I attempt to build a release I get a whole bunch of errors about undefined reference to `Poco:… as outlined in the attachment.

Does anyone know how I can fix this issue?

Note that I have been able to run the example as I compile Poco but I’m not linking to this in anyway as I am under the impression that it is included as part of OF.

It looks like quite some time ago it was being linked to as outlined in http://forum.openframeworks.cc/t/event-handling-±merging-of-with-poco-c++/408/0 but I assume that that is no longer the case, reason being I am using Poco::Logger without any issues.


ps. The reason I am using Poco Net Http rather than HttpUtils is because HttpUtils doesn’t work for me either :frowning:


In case anyone is wondering, the issue was related to this post http://forum.openframeworks.cc/t/user-ldflags-not-user-ld-flags-in-makefile/3546/0

Once I set my vars in the makefile as follows, all went well :slight_smile:

USER_CFLAGS = -I/path/to/poco-1.3.6p2-all/Foundation/include/Poco -I/path/to/poco-1.3.6p2-all/Net/include/Poco/Net  
USER_LDFLAGS = -lcurl -lPocoFoundation -lPocoNet  
USER_LIBS = -L/usr/lib/ -L/path/to/poco-1.3.6p2-all/lib/Linux/i686