# FreeType and FTGL for Code::Blocks

This topic is 4356 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Has anyone successfully compiled FreeType and FTGL for use with Code::Blocks and the GNU compiler? If so can you explain to me how to build them using Code::Blocks?

##### Share on other sites
Yes, it's not a big deal to build freetype IIRC.
What problems are you having?

##### Share on other sites
Hm. Not quite sure what my problem was :). Must've just been a bad day. I just compiled both of them with no problems at all.

[Edited by - NickGravelyn on March 15, 2006 10:33:15 AM]

##### Share on other sites
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 on other sites
Isn't there anyone who can figure out how to get rid of these linker errors?

##### 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:

..\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 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 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).