G'day,

I've tracked down some documentation on the FreeType web pages
(tutorial), which explains why a macro was used for the include
filename:

Quoting from:

        https://www.freetype.org/freetype2/docs/tutorial/step1.html

The tutorial text is:

        Include the file named ft2build.h.

        It contains various macro declarations that are later used
        to #include the appropriate public FreeType 2 header files.

        Include the main FreeType 2 API header file.

        You should do that using the macro FT_FREETYPE_H, like in
        the following example.

        #include <ft2build.h>
        #include FT_FREETYPE_H

        FT_FREETYPE_H is a special macro defined in file ftheader.h.
        It contains some installation-specific macros to name other
        public header files of the FreeType 2 API. [...]

Looking at the code in CD, it does exactly what the tutorial requests...
yet still fails.

Some digging around in various bug reports found the utility
"pkg-config" from freedesktop.org:

        https://www.freedesktop.org/wiki/Software/pkg-config/

You can specify any module managed by this tool -- over 700 packages on
my system:

        $ pkg-config --list-all | wc -l
        707

For a package, one option is "--cflags" -- report the flags that need
to be given to the compiler when compilation of any file that ends up
including the package is attempted.  This flag is broken down into two
subflags:

        pkg-config --cflags-only-I      # Include-path flags only
        pkg-config --cflags-only-other  # Everything not covered by -I

So, for freetype2, on my Gentoo system:

        $ pkg-config freetype2 --cflags
        -I/usr/include/freetype2

So, I believe the reason that "FT_FREETPE_H" fails is because the
include path named above is expected to be given on the compiler
command line, as specified by pkg-config.  Freetype then expects that
all other relevant filenames within /usr/include/freetype2 can be
described relative to that path.

I'm not sure how reliable or portable relying on pkg-config is, except
to note that it was installed, I believe without any intervention by
me, on a Linux Mint system that I had access to (->Ubuntu->Debian?)

Hope this helps,

s-b etc.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to