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

Author Topic: Projects won't run in Xcode  (Read 3249 times)

0 Members and 1 Guest are viewing this topic.

confused

  • Newbie
  • *
  • Posts: 7
    • View Profile
Projects won't run in Xcode
« 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.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Projects won't run in Xcode
« Reply #1 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).
SFML / OS X developer

confused

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Projects won't run in Xcode
« Reply #2 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.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Projects won't run in Xcode
« Reply #3 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 ?
SFML / OS X developer

confused

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Projects won't run in Xcode
« Reply #4 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

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Projects won't run in Xcode
« Reply #5 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).
SFML / OS X developer

confused

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Projects won't run in Xcode
« Reply #6 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.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Projects won't run in Xcode
« Reply #7 on: May 19, 2012, 09:07:29 pm »
SFML / OS X developer

confused

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Projects won't run in Xcode
« Reply #8 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.

confused

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Projects won't run in Xcode
« Reply #9 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.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Projects won't run in Xcode
« Reply #10 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
SFML / OS X developer

 

anything