Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Error building for OSX  (Read 2092 times)

0 Members and 1 Guest are viewing this topic.

Lohoris

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • http://looris.net
Error building for OSX
« on: February 19, 2012, 06:51:48 pm »
The tutorial assumes that if you are under OSX you want to use Xcode. I'd rather not.

Hence, I'm trying to compile SFML from sources: got it from github, ran "cmake ." and then "make".

After a while I got the following error:
Code: [Select]
[ 87%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/VertexArray.cpp.o
Linking CXX shared library ../../../lib/libsfml-graphics.dylib
ld: warning: in /usr/local/lib/libfreetype.dylib, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
  "_FT_Open_Face", referenced from:
      sf::Font::LoadFromStream(sf::InputStream&)      in Font.cpp.o
  "_FT_Set_Pixel_Sizes", referenced from:
      sf::Font::SetCurrentSize(unsigned int) constin Font.cpp.o
      sf::Font::GetLineSpacing(unsigned int) constin Font.cpp.o
      sf::Font::GetKerning(unsigned int, unsigned int, unsigned int) constin Font.cpp.o
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
  "_FT_Done_Face", referenced from:
      sf::Font::Cleanup()    in Font.cpp.o
  "_FT_New_Face", referenced from:
      sf::Font::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Font.cpp.o
  "_FT_Get_Glyph", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
  "_FT_Init_FreeType", referenced from:
      sf::Font::LoadFromStream(sf::InputStream&)      in Font.cpp.o
      sf::Font::LoadFromMemory(void const*, unsigned long)in Font.cpp.o
      sf::Font::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Font.cpp.o
  "_FT_Get_Kerning", referenced from:
      sf::Font::GetKerning(unsigned int, unsigned int, unsigned int) constin Font.cpp.o
  "_FT_Bitmap_Embolden", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
  "_FT_Outline_Embolden", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
  "_FT_Load_Char", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
  "_FT_Glyph_To_Bitmap", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
  "_FT_Select_Charmap", referenced from:
      sf::Font::LoadFromStream(sf::InputStream&)      in Font.cpp.o
      sf::Font::LoadFromMemory(void const*, unsigned long)in Font.cpp.o
      sf::Font::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Font.cpp.o
  "_FT_Done_Glyph", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
  "_FT_New_Memory_Face", referenced from:
      sf::Font::LoadFromMemory(void const*, unsigned long)in Font.cpp.o
  "_FT_Done_FreeType", referenced from:
      sf::Font::Cleanup()    in Font.cpp.o
  "_FT_Get_Char_Index", referenced from:
      sf::Font::GetKerning(unsigned int, unsigned int, unsigned int) constin Font.cpp.o
      sf::Font::GetKerning(unsigned int, unsigned int, unsigned int) constin Font.cpp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [lib/libsfml-graphics.2.0.dylib] Error 1
make[1]: *** [src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/all] Error 2
make: *** [all] Error 2


Am I doing something wrong?

Is there another way to install SFML under OSX to be used just with g++ instead of Xcode?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Error building for OSX
« Reply #1 on: February 19, 2012, 10:25:30 pm »
Quote
The tutorial assumes that if you are under OSX you want to use Xcode.
It does not assume anything – it only says templates are provided in case you want to use Xcode.

Anyway, you need to install Xcode package at least to get compilers (g++/clang/ibtool/...).

Quote from: "Lohoris"
Code: [Select]
ld: warning: in /usr/local/lib/libfreetype.dylib, file was built for i386 which is not the architecture being linked (x86_64)
You're using a custom version of freetype that is not compiled for x86_64 arch, are you ? (Use "file" command to determine which architectures a binary supports.)

The default file on my system is /usr/X11R6/lib/libfreetype.dylib and I get this :
Code: [Select]
$ file /usr/X11R6/lib/libfreetype.dylib
/usr/X11R6/lib/libfreetype.dylib: Mach-O universal binary with 2 architectures
/usr/X11R6/lib/libfreetype.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
/usr/X11R6/lib/libfreetype.dylib (for architecture i386): Mach-O dynamically linked shared library i386
SFML / OS X developer

 

anything