Compiling custom applications in Linux with a Makefile and pkg-config

Note: See the preferred, simpler way of building in any platform using CMake above.
Apart of the CMake approach, MRPT also can be used from users programs built with GNU make by means of pkg-config.

Please, refer to the README and commented Makefile that can be found in MRPT/doc/mrpt_example1-with-Makefile/.

For pkg-config to work you will have to either:

  • Install MRPT in your system, from an Ubuntu repository (libmrpt-dev) or with a “sudo make install”.
  • or, set the environment variable PKG_CONFIG_PATH to include the directory pkgconfig-no-install, for example adding the following to your ~/.basrc file:

Below follows an example Makefile which demonstrated the usage of pkg-config (or see it online):