Building CartoType for Linux
CartoType is written in standard C++ and will compile using CLANG and GCC. Its output is a bitmap in memory, which you can display on any device if you know how your proposed device handles bitmaps. The license allows you to distribute it as part of a binary package, not as source for on-platform compilation. Linux users tend to expect binary packages, so this should not be a problem.
Using CartoType on Linux
The simplest way to use CartoType on Linux is the high-level C++ CFramework API. It wraps all the various objects you need - the map, style sheet, fonts, and routing profiles - and gives you a simple set of functions for drawing the map, interacting with it and searching it, calculating routes and performing turn by turn navigation. The only platform-dependent code you need to write, apart from your application logic, is a routine to draw a CartoType bitmap to your display surface.
Sample code using GLFW
There is a simple demonstration program using the GLFW framework.
The prerequisites are:
- The CartoType Linux evaluation library, libcartotype.a, which is part of the evaluation SDK; you need to link the demo to it.
- The GLFW windowing library, which you will need to install on your Linux computer:
sudo apt-get update
sudo apt-get install libglfw3
sudo apt-get install libglfw3-dev
- You may need to install OpenGL libraries on your Linux computer. I use Mesa, which may already be on your computer. If not, there are various ways to install Mesa. There is some guidance here: https://itsfoss.com/install-mesa-ubuntu/.
Sample code using Qt
The source code of the CartoType Maps App is also available. It uses Qt and runs on Windows, mac OS and Linux.