linuxmakefilecompiler-errorspango

Make compile error -- pango/pango.h: No such file or directory -- but I have pango installed


I have no idea what source file to edit or how to ammend the line. I am installing xplanet-1.3.0 on ubuntu 22.04 from source. I have installed the prerequisites as necessary. ./configure works fine. but make gives this error:

g++ -DHAVE_CONFIG_H -I. -I../..  -I../../src  -I/usr/include/freetype2 -I/usr/include/libpng16   -g -O2 -MT getTextRenderer.o -MD -MP -MF .deps/getTextRenderer.Tpo -c -o getTextRenderer.o getTextRenderer.cpp
In file included from getTextRenderer.cpp:12:
TextRendererPangoFT2.h:4:10: fatal error: pango/pango.h: No such file or directory
    4 | #include <pango/pango.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.

I have pango here: /usr/include/pango-1.0/pango/ How is make not seeing it? how do I tell make where it is? or is it some source file that is confused?

I've tried for days searching for something to edit with no success. Any hints what to look for?


Solution

  • I have pango here: /usr/include/pango-1.0/pango/ How is make not seeing it?

    make is not looking for it at all. It is your compiler, g++, that is looking and not finding. And it is not finding the header because although /usr/include is in the default search path, its subdirectories are not. In particular, /usr/include/pango-1.0 is not.

    how do I tell make where it is? or is it some source file that is confused?

    You tell g++ where to find it by adding /usr/include/pango-1.0 to its search path for #include statements. The -I compiler option serves this purpose.

    You have not presented any information about your actual makefile, so I can't give specific instructions about what to change, but you already have some examples. Look especially at the -I/usr/include/freetype2 and -I/usr/include/libpng16 options as models. I would not be at all surprised to find that these options are recorded in a make variable or two, instead of being expressed explicitly in a recipe, but both approaches are possible.