SFML community forums

Help => General => Topic started by: confused on May 17, 2012, 09:21:08 pm

Title: Projects won't run in Xcode
Post by: confused on May 17, 2012, 09:21:08 pm
Tried to follow the tutorial on using SFML with Xcode. I used the wizard, opened an SFML project in Xcode, tried to run it and got the following error:

ld: library not found for -lsfml-system-d
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Was I supposed to use CMake? I tried doing that, but I couldn't follow the tutorial at all. I didn't have the "CMakeLists.txt" anywhere in the SFML stuff.
Title: Re: Projects won't run in Xcode
Post by: Hiura on May 18, 2012, 06:45:19 pm
the templates provided by the wizard contain a mistake. It is already fixed; see https://github.com/SFML/SFML/issues/212 .

You can get the template from the git repository and install them manually to fix the issue (and, of course, create a new project).
Title: Re: Projects won't run in Xcode
Post by: confused on May 18, 2012, 09:36:10 pm
I downloaded the templates and moved them to /Library/Developer/Xcode where I replaced the old Templates folder with the one, but the option for SFML doesn't come up when creating a new project.
Title: Re: Projects won't run in Xcode
Post by: Hiura on May 19, 2012, 01:29:53 pm
Are you sure /Library/Developer/Xcode/Templates/SFML folder exists ?
What does $ find /Library/Developer/Xcode/Templates -type d prints ?
Title: Re: Projects won't run in Xcode
Post by: confused on May 19, 2012, 07:37:02 pm
I don't think I made another folder for SMFL.

This is what it printed:

/Library/Developer/Xcode/Templates
/Library/Developer/Xcode/Templates/File Templates
/Library/Developer/Xcode/Templates/File Templates/C and C++
/Library/Developer/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate
/Library/Developer/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate/None
/Library/Developer/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate/Private
/Library/Developer/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate/Protected
/Library/Developer/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate/Public
Title: Re: Projects won't run in Xcode
Post by: Hiura on May 19, 2012, 08:18:00 pm
Well, this 'SFML' folder isn't there for nothing.  ;)
Quote from: tutorial
Copy SFML directory from templates/root/Library/Developer/Xcode/Templates to /Library/Developer/Xcode/Templates (if needed create the folder arborescence).
Title: Re: Projects won't run in Xcode
Post by: confused on May 19, 2012, 08:54:47 pm
Oh. I was going off of

"In order to use these templates in Xcode 4 copy the Templates folder to /Library/Developer/Xcode. Create the destination folder if needed."

from the github page.

I created the new folder so now the path is /Library/Developer/Xcode/Templates/SFML, but it didn't help. When I put the folder under Xcode originally I replaced a folder named "Templates" with the one from github. I'm guessing this is the problem.
Title: Re: Projects won't run in Xcode
Post by: Hiura on May 19, 2012, 09:07:29 pm
https://github.com/mantognini/Xcode-4-Templates#install is not related to SFML.
https://github.com/SFML/SFML/blob/76e04a8d00cae47d2fa0dc8b355284e032da54b1/tools/xcode/templates/readme.txt#L14-19 is related to SFML.

Both can cohabit on your system. Just merge the two folders.
Title: Re: Projects won't run in Xcode
Post by: confused on May 19, 2012, 11:40:28 pm
I'm saying that I took the github folder, dragged it into the /Library/Developer/Xcode folder, and replaced the already existing Templates folder.
Title: Re: Projects won't run in Xcode
Post by: confused on May 19, 2012, 11:48:13 pm
Whew. Fixed it. I just ran the install wizard again and moved the folders where I thought they belonged and now everything works.
Title: Re: Projects won't run in Xcode
Post by: Hiura on May 19, 2012, 11:52:10 pm
Apparently (*) you took the templates folder from the wrong repository. Make sure you copy the one from here : https://github.com/SFML/SFML/tree/master/tools/xcode .

(*)  based on :
"In order to use these templates in Xcode 4 copy the Templates folder to /Library/Developer/Xcode. Create the destination folder if needed."

from the github page.
(you read the wrong page)

and

/Library/Developer/Xcode/Templates
/Library/Developer/Xcode/Templates/File Templates
/Library/Developer/Xcode/Templates/File Templates/C and C++
/Library/Developer/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate
/Library/Developer/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate/None
/Library/Developer/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate/Private
/Library/Developer/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate/Protected
/Library/Developer/Xcode/Templates/File Templates/C and C++/C++ Class.xctemplate/Public

You should have (at least) :
Code: [Select]
$ find /Library/Developer/Xcode/Templates -type d
/Library/Developer/Xcode/Templates
/Library/Developer/Xcode/Templates/SFML
/Library/Developer/Xcode/Templates/SFML/SFML Application Base.xctemplate
/Library/Developer/Xcode/Templates/SFML/SFML Application.xctemplate
/Library/Developer/Xcode/Templates/SFML/SFML Command Line Tool Base.xctemplate
/Library/Developer/Xcode/Templates/SFML/SFML Command Line Tool.xctemplate