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

Author Topic: Building SFML 2.0 on Mac OS X Lion  (Read 4874 times)

0 Members and 1 Guest are viewing this topic.

Hachaso

  • Newbie
  • *
  • Posts: 8
    • View Profile
Building SFML 2.0 on Mac OS X Lion
« on: August 04, 2011, 08:07:39 pm »
Hi

I'm having problems building SFML 2.0 on my MAC.
I have followed these intstructions.
http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php

First I tried to build using XCode 4 but encountered the same problem.
Then I tried using MAKE instead but still got this error.

Does anyone know how to solve it ?



Code: [Select]

Linking CXX shared library ../../../lib/libsfml-graphics.dylib
ld: warning: ignoring file /opt/local/lib/libfreetype.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
  "_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::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
      sf::Font::GetKerning(unsigned int, unsigned int, unsigned int) constin Font.cpp.o
  "_FT_Load_Char", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
  "_FT_Get_Glyph", 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_Glyph_To_Bitmap", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
  "_FT_Bitmap_Embolden", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.cpp.o
  "_FT_Done_Glyph", referenced from:
      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_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
  "_FT_Get_Kerning", referenced from:
      sf::Font::GetKerning(unsigned int, unsigned int, unsigned int) 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_Open_Face", referenced from:
      sf::Font::LoadFromStream(sf::InputStream&)      in 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_New_Memory_Face", referenced from:
      sf::Font::LoadFromMemory(void const*, unsigned long)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
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/dy/k6cwbqq57jb4vt69_0ypvvzh0000gn/T//cc0J3NCf.out (No such file or directory)
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

Haikarainen

  • Guest
Building SFML 2.0 on Mac OS X Lion
« Reply #1 on: August 06, 2011, 03:34:05 pm »
Try installing a more native(for you) version of libfreetype, wich is made for your operating system and arch. and use that instead.

Edit; Try builing with this:
./configure CC="gcc -arch i386" CXX="g++ -arch i386"

Hachaso

  • Newbie
  • *
  • Posts: 8
    • View Profile
Building SFML 2.0 on Mac OS X Lion
« Reply #2 on: August 08, 2011, 08:57:57 pm »
I tried that but I get a message that configure does not exist. Can't find it anywhere.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Building SFML 2.0 on Mac OS X Lion
« Reply #3 on: August 08, 2011, 09:44:37 pm »
edit CMAKE_OSX_ARCHITECTURES variable (in cmake's settings) to i386 if you want to support only 32bits applications (which seems odd if you're using Lion)

Did you make a clean installation of Lion or did you update your previous SL ? Did you copied/installed a personal version of freetype at some point ? Which version of Xcode 4 are you using ?
SFML / OS X developer

Hachaso

  • Newbie
  • *
  • Posts: 8
    • View Profile
Building SFML 2.0 on Mac OS X Lion
« Reply #4 on: August 09, 2011, 07:17:24 pm »
Hi!

I upgraded from Snow Leopard to Lion.
Strange that it doesn't work.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Building SFML 2.0 on Mac OS X Lion
« Reply #5 on: August 09, 2011, 08:21:09 pm »
Could you elaborate ?
SFML / OS X developer

Hachaso

  • Newbie
  • *
  • Posts: 8
    • View Profile
Building SFML 2.0 on Mac OS X Lion
« Reply #6 on: August 09, 2011, 09:23:37 pm »
Well I upgraded to Lion and also I'm running XCode 4.
I have also tried to create build scripts using CMAKE, so that I can build with MAKE and command shell. That doesn't work either.

So if someone would have any detailed instructions of how to Build using Lion, either through command shell or XCode 4 that would be really helpful.

The version of XCode I'm using is 4.1.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Building SFML 2.0 on Mac OS X Lion
« Reply #7 on: August 09, 2011, 10:34:20 pm »
I tested Xcode 4.2 beta 5 on Lion and everything works just fine. You'll have to be more precise on the «That doesn't work» part to get useful help.
SFML / OS X developer

at0m

  • Newbie
  • *
  • Posts: 4
    • View Profile
Building SFML 2.0 on Mac OS X Lion
« Reply #8 on: August 19, 2011, 06:15:28 pm »
Hello,
I encounter the same problem with the same configuration, update from SL and move to Xcode4.1. I use  SFML 1.6 before but the Template of SFML 1.6 and XCode4.1 doesn't fit, and some bug using SFML 1.6 template genrate with Xcode 3 and reopen with Xcode4 (when I add File Xcode crash).
 so it makes me move to the 2.0

 I didn't try a shell/make style install. I prepare xcode project file with c make. I leave standard option in C make setting.
I open the SFML.project generate by Cmake with x code 4.1
as target i choose "install" and run :
Code: [Select]

ld: warning: ignoring file /sw/lib/libfreetype.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
  "_FT_Set_Pixel_Sizes", referenced from:
      sf::Font::SetCurrentSize(unsigned int) constin Font.o
  "_FT_Load_Char", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.o
  "_FT_Get_Glyph", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.o
  "_FT_Outline_Embolden", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.o
  "_FT_Glyph_To_Bitmap", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.o
  "_FT_Bitmap_Embolden", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.o
  "_FT_Done_Glyph", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin Font.o
  "_FT_Done_Face", referenced from:
      sf::Font::Cleanup()    in Font.o
  "_FT_Done_FreeType", referenced from:
      sf::Font::Cleanup()    in Font.o
  "_FT_Get_Char_Index", referenced from:
      sf::Font::GetKerning(unsigned int, unsigned int, unsigned int) constin Font.o
  "_FT_Get_Kerning", referenced from:
      sf::Font::GetKerning(unsigned int, unsigned int, unsigned int) constin Font.o
  "_FT_Init_FreeType", referenced from:
      sf::Font::LoadFromStream(sf::InputStream&)      in Font.o
      sf::Font::LoadFromMemory(void const*, unsigned long)in Font.o
      sf::Font::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Font.o
  "_FT_Open_Face", referenced from:
      sf::Font::LoadFromStream(sf::InputStream&)      in Font.o
  "_FT_Select_Charmap", referenced from:
      sf::Font::LoadFromStream(sf::InputStream&)      in Font.o
      sf::Font::LoadFromMemory(void const*, unsigned long)in Font.o
      sf::Font::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Font.o
  "_FT_New_Memory_Face", referenced from:
      sf::Font::LoadFromMemory(void const*, unsigned long)in Font.o
  "_FT_New_Face", referenced from:
      sf::Font::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Font.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

the same freetype probleme
I go back on CMAKE
I put i386 x86_64 in CMAKE_OSX_ARCHITECTURES
as you advice
it answer :
CMAKE_OSX_ARCHITECTURES is not empty.
You're on your own : I won't change your settings.
Configuring done

then I generate anyway ( I belive in fairy tale)
And on Xcode4 it still doesn't work. Do I need to get the Xcode Beta?
Thank you[/b]

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Building SFML 2.0 on Mac OS X Lion
« Reply #9 on: August 19, 2011, 06:28:01 pm »
Quote
I didn't try a shell/make style install. I prepare xcode project file with c make.
Building SFML with Xcode project is not recommended. Use Makefile instead.

Anyway,
Quote
I go back on CMAKE
I put i386 x86_64 in CMAKE_OSX_ARCHITECTURES
as you advice

Don't edit it – if it's empty it will be updated to "i386;x86_64" for you.

Quote
And on Xcode4 it still doesn't work. Do I need to get the Xcode Beta?
In fact the errors have nothing to do with the compiled architectures here. And you don't need Xcode 4.2.

"/sw/lib/libfreetype.dylib" is not supported by SFML (in fact, it's a custom version you installed). You can remove it (but it can break some of your applications) or you can edit FREETYPE_LIBRARY to /usr/X11R6/lib/libfreetype.dylib and FREETYPE_INCLUDE_DIR_* should refer to extlibs/headers from SFML SDK.
SFML / OS X developer

methezer

  • Newbie
  • *
  • Posts: 1
    • View Profile
Building SFML 2.0 on Mac OS X Lion
« Reply #10 on: September 15, 2011, 04:47:08 am »
Quote
or you can edit FREETYPE_LIBRARY to /usr/X11R6/lib/libfreetype.dylib and FREETYPE_INCLUDE_DIR_* should refer to extlibs/headers from SFML SDK.


Thank you!
I was having this exact problem and this absolutely is the correct solution.
I award you 10 internets  :D

 

anything