iDevGames Forums
Xcode and FTGL - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Xcode and FTGL (/thread-113.html)



Xcode and FTGL - hiddenspring81 - Apr 26, 2010 11:42 AM

I just downloaded and installed FTGL and Freetype2 to render text in openGL. I was able to compile and run the demo programs included in the FTGL "demo" folder, but I'm having a hard time using FTGL in my Xcode project. I've added "/usr/local/include/" to the User Header Search Path of my project. When I build the project it fails at the Linking stage, yielding an error regarding the ctor of FTOulineFont. My best guess is that it can't find an implementation of the FTOutlineFont in the "include" directories and that I need to add the proper libraries to my project for it to compile. This is where I'm stuck. Can anyone point me in the right direction?


Xcode and FTGL - OneSadCookie - Apr 26, 2010 03:01 PM

why is FTGL in /usr/local?

just add the dir containing the FTGL headers to your target's header search paths, and drag libftgl.a into your project.

(then realize that FTGL is slow, and has one of the most bizarre APIs known to man).


Xcode and FTGL - akb825 - Apr 26, 2010 08:38 PM

A few years ago when I did some stuff with FTGL, I made an XCode project to compile it into a framework. I still have a download up for it here. Since the latest stable release is in 2004, it should still be up to date. I don't remember if I made any changes to the source code to get it to compile, but if I didn't then you should be able to drop in any newer source and re-use the projects. (though you might have to add or remove files from the project)


RE: Xcode and FTGL - ardowz - Oct 8, 2013 02:21 PM

I'm pretty much stuck at the same place hiddenspring81 is at, but Im getting this error message when I try to compile it when I try to use this line:

Code:
FTPixmapFont infoFont = new FTPixmapFont("/System/Library/Fonts/Helvetica.dfont");

Quote:Undefined symbols for architecture x86_64:
"_BZ2_bzDecompress", referenced from:
_ft_bzip2_file_fill_output in libfreetype.a(ftbzip2.o)
"_BZ2_bzDecompressEnd", referenced from:
_ft_bzip2_stream_io in libfreetype.a(ftbzip2.o)
_ft_bzip2_stream_close in libfreetype.a(ftbzip2.o)
"_BZ2_bzDecompressInit", referenced from:
_FT_Stream_OpenBzip2 in libfreetype.a(ftbzip2.o)
_ft_bzip2_stream_io in libfreetype.a(ftbzip2.o)
"_inflate", referenced from:
_ft_gzip_file_fill_output in libfreetype.a(ftgzip.o)
"_inflateEnd", referenced from:
_FT_Stream_OpenGzip in libfreetype.a(ftgzip.o)
_ft_gzip_stream_close in libfreetype.a(ftgzip.o)
"_inflateInit2_", referenced from:
_FT_Stream_OpenGzip in libfreetype.a(ftgzip.o)
"_inflateReset", referenced from:
_ft_gzip_file_io in libfreetype.a(ftgzip.o)
"_png_create_info_struct", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_create_read_struct", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_destroy_read_struct", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_error", referenced from:
_read_data_from_FT_Stream in libfreetype.a(sfnt.o)
"_png_get_IHDR", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_get_error_ptr", referenced from:
_error_callback in libfreetype.a(sfnt.o)
_read_data_from_FT_Stream in libfreetype.a(sfnt.o)
"_png_get_io_ptr", referenced from:
_read_data_from_FT_Stream in libfreetype.a(sfnt.o)
"_png_get_valid", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_read_end", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_read_image", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_read_info", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_read_update_info", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_set_expand_gray_1_2_4_to_8", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_set_filler", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_set_gray_to_rgb", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_set_interlace_handling", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_set_longjmp_fn", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
_error_callback in libfreetype.a(sfnt.o)
"_png_set_packing", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_set_palette_to_rgb", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_set_read_fn", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_set_read_user_transform_fn", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_set_strip_16", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_png_set_tRNS_to_alpha", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Also @akb825, do you still have the project to compile ftgl into a framework? The link isnt working anymore, I was hoping to leverage that and see if I might have made a mistake installing FTGL and FreeType.

Thanks!


RE: Xcode and FTGL - SethWillits - Oct 9, 2013 01:10 PM

You're not linking against all the requisite libraries. (The "in xyz" ones.) That or you are, but they're not 64-bit. You can lipo -info /path/to/lib to see if it's 64-bit.


RE: Xcode and FTGL - ardowz - Oct 9, 2013 02:11 PM

I changed the target from 64 bit to 32 bit and now its giving me this error:

Code:
Undefined symbols for architecture i386:
  "FTPixmapFont::FTPixmapFont(char const*)", referenced from:
      -[BoxTest renderOutput:withInfo:] in BoxTest.o
  "FTPixmapFont::~FTPixmapFont()", referenced from:
      -[BoxTest renderOutput:withInfo:] in BoxTest.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I also pasted the libftgl.dylib, libftgl.a, libfreetype.a and libfreetype.dylib along with the project.

They are also included in the "Link Binary with Libraries"

Then the headers are searched by the header search path.


RE: Xcode and FTGL - OneSadCookie - Oct 10, 2013 02:59 PM

what necromancy!

why are you trying to use FTGL? don’t do that Sad


RE: Xcode and FTGL - ardowz - Oct 10, 2013 03:00 PM

I'm trying to create 3d text in opengl.

Are there better alternatives to ftgl for 3d text?