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

Author Topic: Linking in Xcode 4  (Read 3288 times)

0 Members and 1 Guest are viewing this topic.

TLHM

  • Newbie
  • *
  • Posts: 2
    • View Profile
Linking in Xcode 4
« on: June 23, 2012, 07:53:25 am »
Hello, I've been trying to get Xcode to import the sfml library to no avail for a while now. I'm running OS 10.7.4 with the latest Xcode (4.3.3), and installed SFML2.0 via the installer. I've tried the template, both using frameworks and not, and neither of them work. Both have linker issues. When using frameworks, it complains on the first include line (say, #include<SFML/Audio.hpp>), saying that the file cannot be found. When not using frameworks, the linker says it cannot find the library
ld: library not found for -lsfml-system-d
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Figuring I'd make an even simpler test, I created a simple command line application project, and added an include line for <SFML/Graphics.hpp>, and then added the SFML framework to the "Link Binary with Libraries" in the Build Phases tab. This also resulted in the file not found error.

I am new to this version of Xcode, so I'm hoping this is caused by some simple error on my part. Any help would be appreciated. Note that I have spent a couple hours now looking at linking tutorials for xcode 4 but none of them seem to have worked. As far as I can tell, the simplest method of doing so is the one I described int he paragraph above, but I also trying adding /usr/local/lib to the library search paths, and adding -lsfml-graphics to the "Other Linker flags", as well as adding the framework directly to the frameworks folder in the project, and just dumping the header files into the project (which I'm sure would raise issues with finding the c files anyways, even if all the imports worked out).

Thanks.
« Last Edit: June 23, 2012, 08:06:32 am by TLHM »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Linking in Xcode 4
« Reply #1 on: June 23, 2012, 10:57:19 am »
These two issues were fixed since RC was released.

The first one : missing debug dylib was a small mistake in the templates. https://github.com/SFML/SFML/issues/212

The second one : "include files not found" issue was introduced by Xcode 4.3.3. https://github.com/SFML/SFML/issues/233
SFML / OS X developer

TLHM

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Linking in Xcode 4
« Reply #2 on: June 23, 2012, 04:32:38 pm »
Thanks. Guess I should have done more searching specifically on site or in the bugs. My bad.