Difficulty: Beginner
Estimated Time: 10 minutes

In this example we are showing how to use existing Conan packages in a C/C++ project.

We are going to build and example using the Poco libraries to compute an MD5. The Poco dependency will be managed with Conan.

Conan is multi-platform, you could run the same examples in Windows or OSX.

Conan C/C++ package manager

Consuming Conan Packages

Step 1 of 3

A simple C++ project

We have a very simple C++ project computing an MD5 checksum from a string using the Poco library. Let's have a look to the project files, you can click at any command to execute it:

show main.cpp

This is a simple program computing an MD5, you can see that we are including some headers from Poco.

show CMakeLists.txt

We are going to use CMake to build our example, but any other build system could be used. The only particular thing in this CMakeLists.txt file is the inclusion of the conanbuildinfo.cmake we will see why very soon.

show conanfile.txt

We use this file to declare:

  • The [requires] of our project, where we declare we need the version 1.9.0 of the Poco library.
  • The [generators]. Conan supports several generators, with the cmake one, we are telling conan to generate a cmake script for us that we can include in the CMakeLists.txt file to "link" with our dependencies, in this case the Poco libraries.
This tab will not be visible to users and provides only information to help authors when creating content.

Creating Katacoda Scenarios

Thanks for creating Katacoda scenarios. This tab is designed to help you as an author have quick access the information you need when creating scenarios.

Here are some useful links to get you started.

Running Katacoda Workshops

If you are planning to use Katacoda for workshops, please contact [email protected] to arrange capacity.

Debugging Scenarios

Below is the response from any background scripts run or files uploaded. This stream can aid debugging scenarios.

If you still need assistance, please contact [email protected]