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

Author Topic: Mac Xcode 3  (Read 1984 times)

0 Members and 1 Guest are viewing this topic.

Explodey

  • Newbie
  • *
  • Posts: 3
    • View Profile
Mac Xcode 3
« on: November 15, 2013, 03:38:30 am »
I've been teaching myself c++ for the past few months, and now that I've finished reading a beginner's c++ textbook, I thought it might be time to try to venture outside of the STL.  So I did some research and it seemed like SFML might be a good place to start.  My problem is that I'm using Xcode 3.2.6, and the OS X tutorial on the sfml site doesn't seem to have any setup help for older versions of Xcode.  So I was just wondering if anyone knew of any resources online that might help me set up my first sfml project in Xcode.

The reason I don't just update Xcode is because I'm still running on Snow Leopard, and I can't update to Mountain Lion because I have a lot of apps that won't run without Rosetta.

Thanks.

Explodey

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Mac Xcode 3
« Reply #1 on: November 15, 2013, 06:39:26 am »
Okay, I decided to try SFML on my Dad's computer, since he does have Xcode 5.  But when I used the install.sh file, I got a long list of "Permission denied" statements.  So I tried copying all the files manually, but some of the directories mentioned in the tutorial didn't exist on my dad's computer (or on my computer either, for that matter).

/usr/local/include
wasn't there.  And the closest thing I could find to this:
/Library/Developer/Xcode/Templates
was this:
Library/Application Support/Apple/Developer Tools/Project Templates

So I put the templates in there, but "sfml" still didn't come up in the new project window in Xcode.

If someone could explain what I'm doing wrong, I'd really appreciate it!

Explodey

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Mac Xcode 3
« Reply #2 on: November 16, 2013, 03:36:39 am »
I figured out what I was doing wrong.  I had to actually create that Templates folder structure.  Then the sfml templates did appear in the Xcode New Project window.  But I could still use some help, because when I try to Run the .app file, I get a long list of linking errors, so I think it must not be finding the frameworks.  I put the frameworks into /Library/Frameworks , and I picked "Clang" in the setup window, which is the version I downloaded, so I don't know why it's not linking.  Please help!

Celtic Minstrel

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Mac Xcode 3
« Reply #3 on: November 18, 2013, 04:08:58 pm »
    Note, I have XCode 4, so it's possible these instructions may be a bit different on Xcode 5.

    Anyway, the reason you're getting linker errors is (probably) because there are two versions of the standard C++ library available on MacOSX. The official distributions of SFML are linked against the GNU standard library, but the default is for projects to link against the LLVM standard library. (I think those descriptors are correct.)

    In XCode 4, this can be changed with the following steps:
    • On your left sidebar (show it if necessary), go to the file browser and click on your project file.
    • In the resulting settings screen, click your project.
    • Type "library" into the search field.
    • Under the "C++ Standard Library" setting, choose "libstdc++" instead of "libc++".
    You might need to adapt these instructions a little for XCode 5. (Perhaps ironically, if you were using XCode 3 this issue wouldn't even exist. :P )

    The other alternative (which is what I did) is to download the SFML source and build it yourself against libc++. I won't go into detail on how to do this, but basically you just need to add "-stdlib=libc++" as a linker argument in CMake. The advantage of this is that libc++ has C++11 support, whereas libstdc++ does not. (For example, it has the regex library, the new shared_ptr, and many other things.)

 

anything