Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7558467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:22:47+00:00 2026-05-30T12:22:47+00:00

Context I’m making a game engine using SDL and OpenGL. I’m trying to find

  • 0

Context

I’m making a game engine using SDL and OpenGL. I’m trying to find the best way to output text to the screen with fancy true type font and I came across FTGL. (If you have better/easier solution, feel free to share it.)

Compiling FTGL

It requires FreeType2 in order to work so I got it, compiled it (using Code::Block) and then I compiled the FTGL lib using Code::Block too.

I’m using Eclipse Indigo with the CDT plugin. I’m not sure which lib to take, since there are a .lib and a .dll file. I tried both, but this doesn’t seem to change my problem at all, which curently is on this line:

FTfont* m_Font = new FTTextureFont(filename.c_str());

The error is:

The type 'FTTextureFont' must implement the inherited pure virtual method 'FTFont::MakeGlyph'

It doesn’t change if I use another FTfont subclass, e.g. FTPixmapFont constructor.

Here are the linker flags which I tried:

-lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_net -lSDL_ttf -lftgl -lfreetype234_D -lopengl32 -lglu32

-lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_net -lSDL_ttf -lftgl -llibfreetype -lopengl32 -lglu32

I’m using eclipse with MinGW.

I have copied and pasted

  • the src/FTGL folder and
  • the content of the Include folder of the freetype library

to the include folder of the MinGW directory.

Both freetype2 (there a are freetype.lib, freetype248_D.lib and freetype-bcc.lib, not sure wich to link in the project properties) and ftgl (ftgl.dll, ftgl_D.lib, ftgl_static_D.lib) lib files into the corresponding lib folder of the MinGW directory.

If I click on the line that has the error and uses the Open Declaration option, eclipse takes me to the FTTextureFont header file which has FTTextureFont(char const*) defined and the MakeGlyph function defined too.

You can find the full code on the GetRandomGame project page if you want to see more, or as a reference.

Here’s the Compiler version

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.1/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.1/configure --enable-languages=c,c++,fortran,objc,ob
j-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp -
-disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runti
me-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.6.1 (GCC)

EDIT

Similar question: FTGL undefined references everywere?, but the answer of that question doesn’t solve my problem, I still get these two errors.


EDIT 2

I was compiling using MSVC when I first tried to use FTGL and had two errors.

I finally used code::block to import the MSVC project provided with both libraries. One of the two errors got solved! But, I still got this one:

The type 'FTTextureFont' must implement the inherited pure virtual method 'FTFont::MakeGlyph'

EDIT 3

I’ve tried to compile FTGL 2.1.2 with freetype 2.3.4 and that hasn’t solved my problem. I’ve tried FTGL 2.1.3 rc5 with freetype 2.3.4, same thing. Just to be sure, I’ve also tried freetype 2.3.5 and 2.4.8 (the first time was already 2.4.8).

I’ve tried moving the MakeGlyph code into the header file, but that hasn’t solved the problem.

Here are some useful links i’ve found, but they haven’t solved the problem yet.

  • OpenGL font rendering with FTGL
  • Glut and FTGL

EDIT 4

When I remove the ftgl linker flag, the compiler complains about this:

undefined reference to FTPixmapFont::FTPixmapFont(char const*)'
collect2: ld returned 1 exit status
Build error occurred, build is stopped

And I still get the pure virtual method MakeGlyph error.

With the ftgl linker flag, the only error I get is the “must implement the inherited Pure Virtual method MakeGlyph”. The compiler builds the project fine (but crashes at start up):

-lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_net -lSDL_ttf -lfreetype -lftgl -lopengl32 -lglu32
Build complete for project GetRandomGame

So I’m thinking that the FTGL lib isn’t compiled correctly since it should have the FTPixmapFont.cpp defining the pure virtual method MakeGlyph. I’m kind of new with all those lib things in c++ and I might be doing something wrong building the lib.


EDIT 5

I have read and seen in an example that I needed to have a config.h file, so I added a properly configured config.h file that comes with FTGL.

Then I found the following code in an example provided in the ftgl directory and I added that to my Font class.

class FTHaloFont : public FTFont
{
    public:
        FTHaloFont(char const *fontFilePath) : FTFont(fontFilePath) {}

    protected:
        virtual FTGlyph* MakeGlyph(FT_GlyphSlot slot)
        {
            return new FTHaloGlyph(slot);
        }
};

Even if I define MakeGlyph there, Eclipse complains about an unimplemented pure virtual method FTFont::MakeGlyph.


EDIT 6

I’ve tried debugging from command line with gdb and it tells me that freetype6.dll can’t be found. I’m trying right now to find a solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:22:48+00:00Added an answer on May 30, 2026 at 12:22 pm

    EDIT 6

    I’ve tried debugging from command line with gdb and it tells me that freetype6.dll can’t be found.

    I have placed freetype6.dll besides my executable file in the debug folder and it worked.

    These are things that have slowed me or that I have learn while searching a solution:

    • Compiling with the same Compiler that I’m using
    • Learn to use code::block to import Visual Studio project
    • Actually be able to compile libraries in code::block without any warnings
    • Playing with linker flag (remove one and see what’s going on) to help solve error and find problems
    • Learn to read provided example to find files that are necessary
    • And use gdb from command line

    I got another problem while renaming some file of the project and I had to reconfigure my whole project in Eclipse (literally delete all files and checkout the SVN again). After that, the pure virtual error had disappeared! So I tried to debug the project and I got this error:

    gdb: unknown target exception 0xc0000135 at 0x7724f52f
    

    Eclipse wasn’t helping me that much, so I tried the command line debugger and it told me that freetype6.dll was missing. And that was it!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context: I'm making a simple solar system simulation in c++/OpenGL. Research: I've tried searching
Context The case is screen scraping web content using QuotaXML SDK 1.6 to finally
Context: We're using an on-screen keyboard on a touch screen kiosk to allow users
Context: HTML widgets generated using a Django ModelForm and template, jQuery 1.3.2, JavaScript on
Context : python 2.6.5 environment I am using unittest.defaultTestLoader.loadTestsFromModule(module) to load tests. However, when
Context: Trying to link a tab to a specific content div on a html
Context: I was going to build app using mod_rewrite (front page loading child pages),
Context: I am trying to upgrade a Grails project from 1.0.3 to 1.3.7 and
context.Response.ContentType = text/plain; context.Response.Write(returnString); If returnString is NULL what will it pass, or will
Context: I am building an Add-in using visual studio 2010. One of the actions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.