The POCO C++ Libraries Blog

Archive: News

POCO C++ Libraries in biicode

Filed under: Development,News by guenter at 15:58

biicode-logo.29235e86

The POCO C++ Libraries are now available via biicode, in the following versions:

The following post has been contributed by Fran Ramírez from the biicode team. You can also find the original post on the biicode blog.

Benefits

biicode is a file based dependency manager, which has many advantages:

  • Save time reusing from any POCO library (Foundation, Net, NetSSL_OpenSSL, etc.) such times as you need and avoid to configure and build out the libraries first. biicode’ll only retrieve the necessary files to build your project.
  • POCO depends on external libraries like zlib, PCRE (Perl Compatible Regular Expressions), HPDF, 7-Zip, OpenSSL and SQLite that they’re uploaded on biicode and maintained by our users.
  • It’s been tested on biicode in Windows with Visual Studio 10 and Visual Studio 12, Linux with GCC and Apple with CLang.

I recommend you to use Visual Studio to configure your project because with MinGW you could get some errors.

POCO External Dependencies

These libraries have many external and third party dependencies to build some of them, e.g., Foundation depends on PCRE and ZLib. Without biicode PCRE and ZLib source files must be present in POCO project, but with biicode it’s not needed. The following table shows all the dependencies for every version uploaded which biicode’ll find if you use all the modules in a project:

So, you’ll not have to worry about to install or build them, biicode does all the effort for you ;) . These are the depending blocks in biicode:

  • PCRE(v8.36): fenix/pcre
  • PCRE(v7.8): fenix/pcre(v7.8)
  • HPDF: fenix/hpdf
  • zlib: zlib/zlib
  • 7-Zip: fenix/7z
  • OpenSSL: lasote/openSSL(v1.0.2)
  • SQLite: fenix/sqlite

Using POCO C++ Libraries In Your Project

1. Create a new project and an empty block:

$ bii init poco_sample
$ cd poco_sample
$ bii new myuser/myblock

2. Add your sample code (orignal code from Net/samples/dict.cpp) into ./blocks/myuser/myblock/sample.cpp:

// dict.cpp
//
// $Id: //poco/1.4/Net/samples/dict/src/dict.cpp#1 $
//
// This sample demonstrates the StreamSocket and SocketStream classes.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier:	BSL-1.0
 
#include "fenix/poco/Net/include/Poco/Net/StreamSocket.h"
#include "fenix/poco/Net/include/Poco/Net/SocketStream.h"
#include "fenix/poco/Net/include/Poco/Net/SocketAddress.h"
#include "fenix/poco/Foundation/include/Poco/StreamCopier.h"
#include "fenix/poco/Foundation/include/Poco/Path.h"
#include "fenix/poco/Foundation/include/Poco/Exception.h"
#include 
 
using Poco::Net::StreamSocket;
using Poco::Net::SocketStream;
using Poco::Net::SocketAddress;
using Poco::StreamCopier;
using Poco::Path;
using Poco::Exception;
 
int main(int argc, char** argv)
{
      const std::string HOST("dict.org");
      const unsigned short PORT = 2628;
 
      if (argc != 2)
      {
            Path p(argv[0]);
            std::cout << "usage: " << p.getBaseName() << " " << std::endl;
            std::cout << "       looks up  in dict.org and prints the results" << std::endl;
            return 1;
      }
      std::string term(argv[1]);
 
      try
      {
            SocketAddress sa(HOST, PORT);
            StreamSocket sock(sa);
            SocketStream str(sock);
 
            str << "DEFINE ! " << term << "\r\n" << std::flush;
            str << "QUIT\r\n" << std::flush;
 
            sock.shutdownSend();
            StreamCopier::copyStream(str, std::cout);
      }
      catch (Exception& exc)
      {
            std::cerr << exc.displayText() << std::endl;
            return 1;
      }
      return 0;
}

3. Choose which uploaded POCO version you want to depend on, configure it through your ./blocks/myuser/myblock/biicode.conf file. Create it and copy the following:

[requirements]
   fenix/poco(v1.6.0): 0

4. Finally, you’d only have to retrieve your POCO dependencies and build your sample.cpp. For it, use this command:

bii cpp:build

Note: for Windows users, to configure your project with Visual Studio, e.g., 10 version, execute:

$ bii cpp:configure -G "Visual Studio 10"
$ bii cpp:build

So, biicode’ll download all the dependencies from release version 1.6.0 and compile the project. Now, you can run the binary created in your ./bin/ folder.

Use The Original #include's

Change all the includes from the previous sample.cpp code to:

...
#include "Poco/Net/StreamSocket.h"
#include "Poco/Net/SocketStream.h"
#include "Poco/Net/SocketAddress.h"
#include "Poco/StreamCopier.h"
#include "Poco/Path.h"
#include "Poco/Exception.h"
...

Now, tell biicode how to find this dependencies, so, modify again the biicode.conf and add the following:

[includes]
    Poco/Net/*.h: fenix/poco/Net/include
    Poco/*.h: fenix/poco/Foundation/include

Warning: take care with Poco/*.h: fenix/poco/Foundation/include because it should always be at the end of [includes] section for being a really wide search pattern.

Finally, clean the metadata and build again the project:

$ bii clean
$ bii cpp:build

Creating A Project With NetSSL_OpenSSL or NetSSL_Win

Making a project using these libraries is a special use case of original includes. Why? Take a look at the following example:

#include "Poco/URIStreamOpener.h"
#include "Poco/StreamCopier.h"
#include "Poco/Path.h"
#include "Poco/URI.h"
#include "Poco/SharedPtr.h"
#include "Poco/Exception.h"
 
/* headers in Net library */
#include "Poco/Net/HTTPStreamFactory.h" 
#include "Poco/Net/FTPStreamFactory.h"
 
/* headers in NetSSL_OpenSSL and NetSSL_Win libraries */
#include "Poco/Net/HTTPSStreamFactory.h" 
#include "Poco/Net/SSLManager.h" 
#include "Poco/Net/KeyConsoleHandler.h" 
#include "Poco/Net/ConsoleCertificateHandler.h"
 
#include 
#include 
 
/* Main code */

Like you see, NetSSL_OpenSSL and NetSSL_Win have the same relative inlcude headers, so, the only way to resolve successfully your dependencies is writing the full path for them.

#include "Poco/URIStreamOpener.h"
#include "Poco/StreamCopier.h"
#include "Poco/Path.h"
#include "Poco/URI.h"
#include "Poco/SharedPtr.h"
#include "Poco/Exception.h"
 
/* headers in Net library */
#include "Poco/Net/HTTPStreamFactory.h" 
#include "Poco/Net/FTPStreamFactory.h"
 
/* headers in NetSSL_OpenSSL library */
#include "fenix/poco/NetSSL_OpenSSL/include/Poco/Net/HTTPSStreamFactory.h" 
#include "fenix/poco/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h" 
#include "fenix/poco/NetSSL_OpenSSL/include/Poco/Net/KeyConsoleHandler.h" 
#include "fenix/poco/NetSSL_OpenSSL/include/Poco/Net/ConsoleCertificateHandler.h"
 
#include 
#include 
 
/* Main code */

The biicode.conf would be like the previous one.

Build All POCO Samples

Try to build all the available samples Poco brings us with each release. Create a project, open any examples/poco block and build it, e.g., examples from 1.4.7p1 version:

$ bii init samples_1_4_7p1
$ bii open "examples/poco(v1.4.7p1)"
$ bii cpp:build

So, that’s all! POCO C++ Libraries are amazing and I strongly recommend you to start using them for your network projects.

I hope you enjoy with this post and don’t forget check our complete C++ documentation! If you’ve any doubt, contact us through our forum or ask directly in Stackoverflow.

Embedded World 2015

Filed under: Events,News by guenter at 08:44

Günter Obiltschnig will be at Embedded World February 24 to 25. We don’t have a booth, but Günter would be happy to meet for lunch, coffee or a drink. Please get in touch if you’d like to schedule a meeting.

Stable Release 1.6.0 Available!

Filed under: News by guenter at 11:11

Release 1.6.0 is the culmination of the work done on GitHub over the last two years, including five development releases. It includes major new features from new contributors, like the JSON and MongoDB libraries, much improved Data library, CMake support, as well as numerous other new features and fixes. A big Thank You to everyone who contributed to this release.

Release 1.4.7p1 Available

Filed under: News by guenter at 19:51

Release 1.4.7p1 fixes a few issues in 1.4.7 and earlier releases. Most important, the Visual C++ project files for Visual C++ 2010 and later have optimization enabled in release builds. Previous builds had optimization disabled due to a bug in Visual Studio when upgrading 2008 project files with custom optimization settings.
There’s a new feature as well – HTTPClientSession now supports a global proxy setting, which will be used by all instances of HTTP(S)ClientSession, including HTTP(S)StreamOpener.
For more information about the release, please see the CHANGELOG.

Happy Thanksgiving!

Stable Release 1.4.7 and Development Release 1.5.4 Available

Filed under: News by guenter at 19:20

Release 1.4.7 is the final release of the 1.4 series and contains bugfixes and a few new features. Development release 1.5.4 should also be the final release of the 1.5 series, before 1.5 “graduates” to stable 1.6. As usual, available on the download page or directly from GitHub.

Development Release 1.5.3 Available

Filed under: News by guenter at 10:49

Development Release 1.5.3 is now available for download.

Release highlights:

New Libraries:

  • SevenZip

New Classes:

  • Poco::Clock
  • Poco::Net::NTPClient

New major features:

  • Windows PowerShell build script

New Platforms supported:

  • SmartOS
  • Windows Embedded Compact 2013

and many more bugfixes and improvements; see the CHANGELOG for details. Available on the download page or from GitHub.

POCO 1.5.3 Release Candidate 1 Available

Filed under: Development,News by alex at 05:06

Release Candidate 1 of POCO 1.5.3 has been tagged on the GitHub. Release 1.5.3 is scheduled for June 30 2014.

See POCO in Action at Embedded World

Filed under: News by guenter at 14:31

I’m having a lot of fun at Embedded World 2014, showing our new IoT Plaform based (of course) on POCO.
Thanks to everyon who’s already visited. Really enjoyed the chats. If you’re in Nürnberg, come to hall 4, booth 470h.

ew2014

Building a Cloud Service With POCO: my-devices.net

Filed under: News by guenter at 22:55

Applied Informatics has just released a new and much improved version of my-devices.net, along with a completely new website. my-devices.net is cloud-ready service providing secure remote access to embedded devices and intelligent systems via HTTP(S) or other TCP-based protocols. With my-devices.net, any network-connected device running the my-devices.net connector software can be securely accessed remotely over the internet from browsers, mobile apps, desktop, server or cloud applications using HTTP(S) or TCP-based protocols. This even works if the device is behind a NAT router, firewall or proxy server. The device becomes just another host on the internet, addressable via its own URL and protected by the my-devices.net server against unauthorized or malicious access.

The server application and the software that connects the device to the server are based on POCO, of course. See our blog post at the Applied Informatics Blog or go directly to my-devices.net for more information.

Applied Informatics at ESE Kongress 2013

Filed under: Events,News by guenter at 21:20

ESE Kongress Banner
Meet me at Embedded Software Engineering Kongress in Sindelfingen, Germany, from December 3-5 in the exhibition area and if you’re there, don’t miss my talk “Sichere Fernwartung über das Internet” (secure internet-based remote access and management) on Thursday, December 5. Looking forward to meeting you there!

Günter

Next Page »