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

  • Home
  • SEARCH
  • 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 6167417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:30:34+00:00 2026-05-23T22:30:34+00:00

I am compiling with MinGW in Windows 7, using Code::Blocks as the IDE. Everything

  • 0

I am compiling with MinGW in Windows 7, using Code::Blocks as the IDE. Everything should be up to date. I noticed there are a number of similar questions, but those seemed to be about linking a dynamic library, not compiling the static library.

I am trying to use FTGL to be able to use text in OpenGL. FTGL requires FreeType 2 be installed. I downloaded the FreeType source, and followed the INSTALL.GNU instructions to build the static library from CMD.EXE, using mingw32-make.exe.

As the instructions indicated, I ran mingw32-make from the base directory of the FreeType installation. The console output was as expected:

D:\freetype-2.4.4>mingw32-make

FreeType build system -- automatic system detection

The following settings are used:

  platform                     win32
  compiler                     gcc
  configuration directory      .\builds\win32
  configuration rules          .\builds\win32\w32-gcc.mk

If this does not correspond to your system or settings please remove the file
'config.mk' from this directory then read the INSTALL file for help.

Otherwise, simply type 'make' again to build the library.
or 'make refdoc' to build the API reference (the latter needs python).

Could Not Find D:\freetype-2.4.4\objs\ftmodule.h
Generating modules list in ./objs/ftmodule.h...
"* module: truetype  (Windows/Mac font files with extension *.ttf or *.ttc)"
"* module: type1     (Postscript font files with extension *.pfa or *.pfb)"
"* module: cff       (OpenType fonts with extension *.otf)"
"* module: cid       (Postscript CID-keyed fonts, no known extension)"
"* module: pfr       (PFR/TrueDoc font files with extension *.pfr)"
"* module: type42    (Type 42 font files with no known extension)"
"* module: winfnt    (Windows bitmap fonts with extension *.fnt or *.fon)"
"* module: pcf       (pcf bitmap fonts)"
"* module: bdf       (bdf bitmap fonts)"
"* module: sfnt      (helper module for TrueType & OpenType formats)"
"* module: autofit   (automatic hinting module)"
"* module: pshinter  (Postscript hinter module)"
"* module: raster    (monochrome bitmap renderer)"
"* module: smooth    (anti-aliased bitmap renderer)"
"* module: smooth    (anti-aliased bitmap renderer for LCDs)"
"* module: smooth    (anti-aliased bitmap renderer for vertical LCDs)"
"* module: psaux     (Postscript Type 1 & Type 2 helper module)"
"* module: psnames   (Postscript & Unicode Glyph name handling)"
done.

Seeing as both the platform and compiler were correct, I ran the make command again:

D:\freetype-2.4.4>mingw32-make
(bunch of calls, building objects then linking them, until:)
ar: creating objs/freetype.a

This produced the file freetype.a in the directory D:\freetype-2.4.4\objs.

I then did the steps in Code::Blocks to link the library to the project, added a sample bit of code to test FTGL, and tried to build it.

I’m having two errors, depending on how I try to do things.

If I provide the correct directory to the linker (-LD:\freetype-2.4.4\objs), and link with -lfreetype, everything is fine until ld.exe quits with the error in the title, cannot find -lfreetype.

If I don’t provide the correct directory, I get the same error. Can’t find the library.

If I change the name of the file, freetype.a, to libfreetype.a, and provide the right directory, I instead get several undefined references.

obj\Release\CApp_OnRender.o:CApp_OnRender.cpp:(.text+0x250): undefined reference to `FTPixmapFont::FTPixmapFont(char const*)'
obj\Release\CApp_OnRender.o:CApp_OnRender.cpp:(.text+0x258): undefined reference to `FTFont::Error() const'
obj\Release\CApp_OnRender.o:CApp_OnRender.cpp:(.text+0x274): undefined reference to `FTFont::FaceSize(unsigned int, unsigned int)'
obj\Release\CApp_OnRender.o:CApp_OnRender.cpp:(.text+0x308): undefined reference to `FTFont::Render(char const*, int, FTPoint, FTPoint, int)'
obj\Release\CApp_OnRender.o:CApp_OnRender.cpp:(.text+0x316): undefined reference to `FTPixmapFont::~FTPixmapFont()'
obj\Release\CApp_OnRender.o:CApp_OnRender.cpp:(.text+0x328): undefined reference to `FTPixmapFont::~FTPixmapFont()'
collect2: ld returned 1 exit status

If I provide the wrong directory, again I get the previous error that it couldn’t find the library.

I found it odd that the make would, when following the directions in the install file, produce a library with a name that didn’t start with lib. I checked and every single other .a file started with lib-. And it seems like the linker is looking for the file libfreetype.a. So why is the make creating freetype.a instead? This is using the same compiler for the library that I’m using to compile the program.

Anyway, not sure where to go from here. I thought of using the MSys shell that is part of the MinGW package, but I don’t have much experience with it and the instruction in INSTALL.UNIX assume you know the more obvious commands. They mention using ./configure [options], without mention of what options might be advisable. Probably obvious to someone with more knowledge of the system, but MSys is my first experience with sh.

I’d appreciate any help with this matter.

  • 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-23T22:30:35+00:00Added an answer on May 23, 2026 at 10:30 pm

    My version of libfreetype.a (2.4.4, built from modified debian package) does not export the symbols your linker is looking for (FTPixmapFont constructor), nor do the headers declare such a class. A quick google search indicates they belong to FTGL.

    Renaming your import file to libfreetype.a was correct (the mingw ld won’t find it otherwise), but did you also link to the necessary FTGL libraries?

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

Sidebar

Related Questions

I'm compiling using Code::Blocks on Windows 7 using the MinGW compiler (which I can
Using: windows xp, g++ 3.4.4 with cygwin and g++ 3.4.5 with mingw. I'm compiling
After compiling a simple C++ project using Visual Studio 2008 on vista, everything runs
I'm building an application for Windows XP using the MinGW tool chain and it
I'm trying to build cairo on Windows using MinGW (and MSYS). I am following
I am having trouble compiling wxwidgets with mingw on Windows 7 x64. It compiles
I am compiling this program on Windows, with gcc (MinGW) and GTK+: #include <gtk/gtk.h>
When compiling the following code: void DoSomething(int Numbers[]) { int SomeArray[] = Numbers; }
I'm compiling a simple .c in visual c++ with Compile as C Code (/TC)
How to configure mingw32 to cross-compile Direct3D Apps for Windows? Is there any possibility?

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.