Sign in to follow this  
NickGravelyn

FreeType and FTGL for Code::Blocks

Recommended Posts

I am, however, having problems using the libraries with Code::Blocks. I added both libraries, include directories, and library directories to my project but I get these linker errors:

..\Dependencies\Windows/libftgl.a(FTSize.o):FTSize.cpp:(.text+0x16b): undefined reference to `FT_Set_Char_Size'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0xcb): undefined reference to `FT_New_Face'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0x23d): undefined reference to `FT_New_Face'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0x3ac): undefined reference to `FT_New_Memory_Face'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0x504): undefined reference to `FT_New_Memory_Face'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0x5ee): undefined reference to `FT_Done_Face'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0x6e2): undefined reference to `FT_Done_Face'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0x7d6): undefined reference to `FT_Done_Face'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0x88d): undefined reference to `FT_Attach_File'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0x8d8): undefined reference to `FT_Attach_Stream'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0xa3d): undefined reference to `FT_Get_Kerning'
..\Dependencies\Windows/libftgl.a(FTFace.o):FTFace.cpp:(.text+0xab8): undefined reference to `FT_Load_Glyph'
..\Dependencies\Windows/libftgl.a(FTPixmapGlyph.o):FTPixmapGlyph.cpp:(.text+0xb6): undefined reference to `FT_Render_Glyph'
..\Dependencies\Windows/libftgl.a(FTPixmapGlyph.o):FTPixmapGlyph.cpp:(.text+0x372): undefined reference to `FT_Render_Glyph'
..\Dependencies\Windows/libftgl.a(FTCharmap.o):FTCharmap.cpp:(.text+0xa1): undefined reference to `FT_Set_Charmap'
..\Dependencies\Windows/libftgl.a(FTCharmap.o):FTCharmap.cpp:(.text+0x1af): undefined reference to `FT_Set_Charmap'
..\Dependencies\Windows/libftgl.a(FTCharmap.o):FTCharmap.cpp:(.text+0x311): undefined reference to `FT_Select_Charmap'
..\Dependencies\Windows/libftgl.a(FTCharmap.o):FTCharmap.cpp:(.text+0x393): undefined reference to `FT_Get_Char_Index'
..\Dependencies\Windows/libftgl.a(FTLibrary.o):FTLibrary.cpp:(.text+0x63): undefined reference to `FT_Done_FreeType'
..\Dependencies\Windows/libftgl.a(FTLibrary.o):FTLibrary.cpp:(.text+0x99): undefined reference to `FT_Done_FreeType'
..\Dependencies\Windows/libftgl.a(FTLibrary.o):FTLibrary.cpp:(.text+0x137): undefined reference to `FT_Init_FreeType'
..\Dependencies\Windows/libftgl.a(FTGlyph.o):FTGlyph.cpp:(.text$_ZN6FTBBoxC1EP16FT_GlyphSlotRec_[FTBBox::FTBBox(FT_GlyphSlotRec_*)]+0x58): undefined reference to `FT_Outline_Get_CBox'


Share this post


Link to post
Share on other sites
I tried again at rebuilding the libraries with much better success using the project import tool of Code::Blocks. Now when I compile my program that uses the two libraries, I only get this one error:

Linking executable: SimEngine.exe
..\Dependencies\Windows/libfreetype2110MT.a(ftinit.o):ftinit.c:(.rdata+0x44): undefined reference to `otv_module_class'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)

Any ideas what that means and how I could fix it? I built the libraries in Code::Blocks using the GNU GCC compiler if that matters.

Share this post


Link to post
Share on other sites
I checked my linker order. It's currently set to
FTGL
FreeType
OpenGL

My error is a little different from those in that thread. I'm not sure what exactly it's complaining about. It doesn't seem to be a function, but rather some type. Is it possible that FreeType somehow didn't build with that type?

Share this post


Link to post
Share on other sites
For anyone getting the last error I posted, simply open up the freetype project, go into ftmodule.h and comment out the line that says

FT_USE_MODULE(otv_module_class)


Then rebuild FreeType and then rebuild FTGL linking to these files and libraries and you should be all set (it worked for me).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this