Skip to content

error: 'FT_Done_MM_Var' was not declared in this scope during CentOS7 install #155

Closed

Description

@SSSJe

When attempting to install the systemfonts package via pak::pak('r-lib/systemfonts'), I encountered compilation errors related to Freetype functions/constants. Below are the detailed error logs, along with my current Freetype version info and relevant context:

1. Compilation Error Logs

ft_cache.cpp: In function 'std::string enc_to_string(FT_Encoding_)':
ft_cache.cpp:221:10: error: 'FT_ENCODING_PRC' was not declared in this scope; did you mean 'FT_ENCODING_SJIS'?
221 | case FT_ENCODING_PRC: return "prc";
| ^~~~~~~~~~~~~~~
| FT_ENCODING_SJIS
ft_cache.cpp: In member function 'FontFaceInfo FreetypeCache::font_info()':
ft_cache.cpp:257:24: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'FT_Int' {aka 'int'} [-Wsign-compare]
257 | for (size_t i = 0; i < face->num_charmaps; ++i) {
| ~~^~~~~~~~~~~~~~~~~~~~
ft_cache.cpp:292:7: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
292 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
ft_cache.cpp: In member function 'std::vector FreetypeCache::cur_axes()':
ft_cache.cpp:456:3: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
456 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
ft_cache.cpp: In member function 'void FreetypeCache::has_axes(bool&, bool&, bool&)':
ft_cache.cpp:476:5: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
476 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
ft_cache.cpp: In member function 'int FreetypeCache::n_axes()':
ft_cache.cpp:489:5: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
489 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
ft_cache.cpp: In member function 'bool FreetypeCache::is_variable()':
ft_cache.cpp:500:5: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
500 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
ft_cache.cpp: In member function 'void FreetypeCache::set_axes(const int*, const int*, size_t)':
ft_cache.cpp:545:3: error: 'FT_Done_MM_Var' was not declared in this scope; did you mean 'FT_Get_MM_Var'?
545 | FT_Done_MM_Var(library, variations);
| ^~~~~~~~~~~~~~
| FT_Get_MM_Var
make: *** [/data1/workspace/wind/miniconda3/envs/seurat4/lib/R/etc/Makeconf:200: ft_cache.o] Error 1
ERROR: compilation failed for package ‘systemfonts’

Current Freetype Version in My Environment

Image Image

Some suggestions mentioned updating Freetype, but I want to confirm:

  • Whether updating Freetype is the definitive fix for these errors?

  • If so, what minimum Freetype version is required?

  • Are there alternative workarounds (e.g., compiling flags, package versions) if updating Freetype is not feasible in my environment?

This issue matches #149 exactly, but none of the suggested fixes (e.g., Freetype update) have worked—I still get the FT_ENCODING_PRC/FT_Done_MM_Var undefined errors. Any other workarounds or compatible versions to try?
Looking for reply. : )

Activity

  1. SSSJe commented on Aug 18, 2026

    @SSSJe
    Author

    After spending some time investigating, I noticed an issue with the Freetype library in my Conda environment.

    In my build process, I encountered an error like 'FT_ENCODING_PRC' was not declared.
    grep -R "FT_ENCODING_PRC" /path/to/include
    This macro is typically defined in freetype/ftmm.h (or possibly freetype2/freetype/ftmm.h). To verify its presence, I performed the following checks:
    find "$CONDA_PREFIX/include" -name "ftmm.h ls -lh "$CONDA_PREFIX/include/freetype2/freetype/ftmm.h" wc -c "$CONDA_PREFIX/include/freetype2/freetype/ftmm.h" grep -n "FT_ENCODING_PRC" \ "$CONDA_PREFIX/include/freetype2/freetype/ftmm.h""
    Image
    As shown in the screenshot below, ftmm.h contains no definition for FT_ENCODING_PRC. This suggests that the installed **Freetype ** might be incomplete or corrupted. To resolve this, I reinstalled Freetype :
    conda install --override-channels -c conda-forge freetype=2.14.3
    After a successful installation, I verified again:
    grep -n "FT_ENCODING_PRC" \ "$CONDA_PREFIX/include/freetype2/freetype/ftmm.h" | head
    This time, everything is ok. : )
    Maybe this will serve as a reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions