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

Author Topic: SFML 2 for OS X comes true!  (Read 104752 times)

0 Members and 2 Guests are viewing this topic.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #165 on: May 15, 2011, 02:42:25 pm »
I don't really know if you got the install_name thing working, I didn't see anything on the Git repo. If that can be of any help, here's what I added in the sfeMovie CMake file to get it done:
Code: [Select]

set_target_properties(${LIB_NAME} PROPERTIES
  BUILD_WITH_INSTALL_RPATH 1
  INSTALL_NAME_DIR "@executable_path/../Frameworks")


You can replace the path with anything you want but that's the idea.
Want to play movies in your SFML application? Check out sfeMovie!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #166 on: May 15, 2011, 03:09:44 pm »
Well! A big thanks! No one could answer my question on the cmake mailing list so I had to go through all the sources to realize that you absolutely cannot use suffix nor postfix. So that's a very good hint you gave me here!

I'll check that out.  :wink:
SFML / OS X developer

Vit

  • Newbie
  • *
  • Posts: 14
    • View Profile
SFML 2 for OS X comes true!
« Reply #167 on: May 25, 2011, 05:40:30 pm »
This probably isn't the right place to post this, but I've found that closing the SFML window sometimes makes my computer emit a brief loud 'static' sound through the speakers (even if the volume is completely down). I'm using a 2005 Macbook running Mac OS X 10.6. I've experienced this problem in two different projects which don't share any code, so I don't think it's a problem with my code (unless there's something funny going on with my OpenGL calls; I'm using straight OpenGL for map rendering in both, though again, the code is completely different).
I'm not sure what's going on here, and it's starting to worry me...

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #168 on: May 25, 2011, 09:04:22 pm »
I've some issues with my mac (sometimes, at completely random interval, it produce a very very acute noise that tears my ears apart then the speaker don't produce any sound for about 2 minutes) but I've also experienced, not always though, something like you said : closing the window make a strange unknown noise. I've never considered this as relevant because of the issues I've got with my speakers. And frankly I've no clue at all why on earth any sound should be produced! I don't use anything (even indirectly) related to the sound in the window management code.

Does this "thing" occur on anyone else computer ?
SFML / OS X developer

SkyJedi

  • Full Member
  • ***
  • Posts: 185
    • MSN Messenger - NicolasAllemand2@hotmail.com
    • AOL Instant Messenger - SkyJedi01
    • Yahoo Instant Messenger - fuyayaa
    • View Profile
    • http://www.black-heaven.fr/devblog
SFML 2 for OS X comes true!
« Reply #169 on: August 04, 2011, 07:13:08 pm »
Hey,

I'm on Mac OS X 10.7, I just installed the developer tools, grabbed the SFML files on git, compiled it with cake, installed it, installed the templates...
But yeah, when I try to compile a template, I've got this

What can I do? :/
Thanks in advance

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #170 on: August 04, 2011, 07:35:39 pm »
you probably compiled sfml in release mode. you can either change your project settings to release (edit scheme) or recompile sfml in debug (recommended as you'll probably need both release and debug).
SFML / OS X developer

SkyJedi

  • Full Member
  • ***
  • Posts: 185
    • MSN Messenger - NicolasAllemand2@hotmail.com
    • AOL Instant Messenger - SkyJedi01
    • Yahoo Instant Messenger - fuyayaa
    • View Profile
    • http://www.black-heaven.fr/devblog
SFML 2 for OS X comes true!
« Reply #171 on: August 04, 2011, 07:57:29 pm »
I compiled the library in debug mode, and it works, thanks!

Hachaso

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML 2 for OS X comes true!
« Reply #172 on: August 04, 2011, 08:33:21 pm »
How can I build SFML 2.0 using XCode 4 ?

I get these errors:

Code: [Select]



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




Code: [Select]

ld: warning: ignoring file /opt/local/lib/libfreetype.dylib, file was built for unsupported file format which is not the architecture being linked (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


Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #173 on: August 04, 2011, 08:42:53 pm »
Rename /opt/local/lib/libfreetype.dylib to some other name so that the linker does no more find it. Mac OS X already includes a freetype library including the correct architectures.
Want to play movies in your SFML application? Check out sfeMovie!

Hachaso

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML 2 for OS X comes true!
« Reply #174 on: August 04, 2011, 08:50:09 pm »
Thanks

Worked a little better know I get these errors when I Select OpenGL and Build

Code: [Select]


Ld BUILD/src/SFML/Graphics/SFML.build/Debug/sfml-graphics.build/Objects-normal/i386/libsfml-graphics-d.dylib normal i386
    cd /Users/brcal/programming/MacOSX/SFML-2.0
    setenv MACOSX_DEPLOYMENT_TARGET 10.7
    /Developer/usr/bin/llvm-g++-4.2 -arch i386 -dynamiclib -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Users/brcal/programming/MacOSX/SFML-2.0/BUILD/lib/Debug -F/Users/brcal/programming/MacOSX/SFML-2.0/BUILD/lib/Debug -filelist /Users/brcal/programming/MacOSX/SFML-2.0/BUILD/src/SFML/Graphics/SFML.build/Debug/sfml-graphics.build/Objects-normal/i386/sfml-graphics-d.LinkFileList -install_name /libsfml-graphics-d.dylib -mmacosx-version-min=10.7 -dynamiclib -Wl,-headerpad_max_install_names -install_name libsfml-graphics-d.dylib /Users/brcal/programming/MacOSX/SFML-2.0/BUILD/lib/Debug/libsfml-window-d.dylib /Users/brcal/programming/MacOSX/SFML-2.0/BUILD/lib/Debug/libsfml-system-d.dylib /opt/local/lib/libfreetype.dylib /Users/brcal/programming/MacOSX/SFML-2.0/extlibs/libs-osx/lib/libGLEW.a /Users/brcal/programming/MacOSX/SFML-2.0/extlibs/libs-osx/lib/libjpeg.a -framework OpenGL /usr/lib/libz.dylib -framework AGL -lpthread -framework Foundation -framework AppKit -framework IOKit -framework Carbon -single_module -compatibility_version 2.0.0 -current_version 2.0.0 -o /Users/brcal/programming/MacOSX/SFML-2.0/BUILD/src/SFML/Graphics/SFML.build/Debug/sfml-graphics.build/Objects-normal/i386/libsfml-graphics-d.dylib

Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

Hachaso

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML 2 for OS X comes true!
« Reply #175 on: August 04, 2011, 08:54:35 pm »
I can't seem to find any other libfreetype.dylib installed on my Mac OS X Lion.
Do I need to download it from somewhere ?

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #176 on: August 04, 2011, 09:08:04 pm »
There is no relevant information in your last error log. I dunno if it changed for OS X Lion, but freetype is supposed to be located at /usr/X11/lib/libfreetype.dylib.
Want to play movies in your SFML application? Check out sfeMovie!

Hachaso

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML 2 for OS X comes true!
« Reply #177 on: August 04, 2011, 09:15:19 pm »
That is correct:

I found the file now but it's a Alias file pointing at libfreetype.6.dylib at the same location you posted before.

Do you have any idea what my last error means ??

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #178 on: August 04, 2011, 09:25:40 pm »
As I previously said, there is no relevant information in your last error log, so nothing can be deduced. There's most probably relevant information before this error.

And the alias pointing to lifreetype.6.dylib is fine.
Want to play movies in your SFML application? Check out sfeMovie!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #179 on: August 20, 2011, 12:51:18 pm »
Frameworks are now available. BUILD_FRAMEWORKS can be set to TRUE to build SFML as frameworks. NB : frameworks are only available in release. There is no sfml-*-d.framework.

Cmake automatically installs the xcode 4 templates for you if INSTALL_XCODE4_TEMPLATES is set to TRUE.

The templates were updated to let you choose between frameworks and dylibs.

If you choose to create a application bundle (.app) SFML dylibs or SFML frameworks, and sndfile framework, are copied to your bundle so you can send it as-is to people when you build it for "archive".

Please refer to xcode/templates/readme.txt for more details.

Have fun!  :wink:

(I've updated the first post of this topic. It should contain everything you need to use SFML on Mac.)
SFML / OS X developer