[solved] Cannot link libraries [Linux]

I’ve read and watched several tutorials on how to link libraries into Projucer but cannot get it to compile.
I’m working on a Linux Machine (Ubuntu 16.04) and using the Linux Makefile to compile.

What I’ve done:

  • Adding the directory- path in the “Exporter” section to:
    -) “External Libraries to Link” (Linux Makefile)
    -) “Header Search Path” (Linux Makefile - Debug)
    -) “Extra Library Search Paths” (Linux Makefile - Debug)
  • Add the library to the source (via Drag & Drop)
  • Added #include “maximilian.h” into the PluginProcessor.cpp file
  • Tried to compiled it

I get the error:

fatal error: maximilian.h: No such file or directory
#include “maximilian.h”
compilation terminated.
Makefile:132: recipe for target ‘build/intermediate/Debug/PluginProcessor_a059e380.o’ failed

What have I done wrong?

Thanks a lot in advance!

The problem here is not in the linking stage, but in the compilation stage, because the compiler can’t find the header. Have you checked that one of the header search paths actually is the directory where your maximilian.h file lies?

You can find the exact location by running

locate maximilian.h

in your shell. Sometimes the header lies in a subdirectory of the include path.

#include "something/maximilian.h"

Thanks for your answer!
I solved the problem by adding only the library- directory into the

  • “Header Search Path” (Linux Makefile - Debug) section.

and deleted it from:

  • “Extra Library Search Paths” (Linux Makefile - Debug)
  • “External Libraries to Link” (Linux Makefile)