Include libraries from a different path

gcc

  • Preprocess and compile C and C++ source files, then assemble and link them together.
    More information: <https://gcc.gnu.org>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

gcc {{path/to/source.c}} -o {{path/to/output_executable}} -I{{path/to/header}} -L{{path/to/library}} -l{{library_name}}

click the source code to copy install gcc on any operating system with command-not-found.com