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

Author Topic: SFML Game Development Book code and Xcode 5.0.1  (Read 2586 times)

0 Members and 1 Guest are viewing this topic.

The Thinker

  • Newbie
  • *
  • Posts: 19
    • View Profile
SFML Game Development Book code and Xcode 5.0.1
« on: November 08, 2013, 05:05:38 pm »
Hi all, I'm new in this forum and not so experienced with Xcode (I have just bought my first Mac).

I studied C++  (Accelerated C++ and C++ Programming in easy steps 4 edition) and now I would like to learn SFML so I bought "SFML Game Development book"

I configured SFML 2.1 so I downloaded:

-Clang - universal 32+64 bits (OS X 10.8+, compatible with C++11 and libc++)
-Templates for Xcode 5

and as you can see in the image linked below everything seems working ok ( I hope so, if we don't consider: Error>: The function `CGContextErase' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.
)

http://s10.postimg.org/sewols9t5/Screen_Shot_2013_11_08_at_15_37_18.png

Anyway the main problem is that I cannot run in Xcode 5.0.1 the sfml-book.xcodeproj (that I generated with cmake 2.8) after downloading the compressed archive from Laurent Gomita github.com).

It gives me the following errors:

http://s8.postimg.org/5rlh55591/Screen_Shot_2013_11_08_at_16_01_06.png

I guess it's a problem with the linker or something but I'm not so skilled with Xcode.

Can someone please help me and tell me step by step how to fix this so I can start to study this lovely book?

Thank you in advance

The Thinker

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML Game Development Book code and Xcode 5.0.1
« Reply #1 on: November 09, 2013, 02:11:41 pm »
I'm not very familiar with XCode or OS X, but in the past there have been problems concerning the confusion of standard libraries. It is possible to choose either -stdlib=libc++ (clang) or -stdlib=libstdc++ (g++), however newer systems seem to use libc++, which is the default in the CMake configuration.

Have you tried searching for the error message? Maybe a OS X user can help here...
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

JyNo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: SFML Game Development Book code and Xcode 5.0.1
« Reply #2 on: November 10, 2013, 03:29:52 am »
Hello,

I am also having troubles with Xcode 5.0.1 and SFML. But mine are pretty dumb. I recently upgraded from Snow Leopard to Mavericks (clean install) and got Xcode 5. In SL I used SFML 2.0 and I didn't use the templates since I couldn't get Xcode 4, I compiled my projects from terminal with a command like "g++ main.cpp -framework sfml-graphics -framework sfml-window -framework sfml-system".

Now, here is my problem, I downloaded SFML 2.1 (clang version), and moved the frameworks and extlibs files to my /Library/Frameworks/ folder. However, I couldn't figure out where to put the Xcode 5 templates but I could not find the /Library/Developer/Xcode/Templates folder. I think that since now Xcode is a stand alone app there is no such folder anymore, so I don't know how to set up the templates. I tried looking in /Applications/Xcode.app/Contents/ but there is no folder for templates there either. May I ask how you set the templates up The Thinker?

Another thing is that my command line compilation doesn't work anymore either. I tried dumping the frameworks in the /Applications/Xcode.app/Contents/Frameworks folder but that doesn't work either. If I try to complile as before I get an error :

"JyNorbita:desktop JyNo$ g++ main.cpp -framework sfml-graphics -framework sfml-window -framework sfml-system
main.cpp:1:10: fatal error: 'SFML/Graphics.hpp' file not found
#include <SFML/Graphics.hpp> "

Thanks in advance for you help.

JyNo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: SFML Game Development Book code and Xcode 5.0.1
« Reply #3 on: November 11, 2013, 11:06:50 pm »
I feel really stupid now. I just created the required folder and now I have the template working on Xcode. I still don't know what the problem is with my command line compilation but now that I have the Xcode template up and running maybe it is not so important.

Cheers.

 

anything