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

Author Topic: Cannot get template project to run in Xcode  (Read 2139 times)

0 Members and 1 Guest are viewing this topic.

tylermfdurden

  • Newbie
  • *
  • Posts: 2
    • View Profile
Cannot get template project to run in Xcode
« on: September 11, 2013, 05:53:16 am »
In Xcode 4.3.3, on OSX 10.7.5, I am creating a new SFML app, with C++11 and Clang.

If I run it as is, I get linker errors:
Undefined symbols for architecture x86_64:
  "_objc_msgSend", referenced from:
      resourcePath() in ResourcePath.o
  "_NSLog", referenced from:
      resourcePath() in ResourcePath.o
  "_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
      objc-class-ref in ResourcePath.o
  "_objc_msgSend_fixup", referenced from:
      l_objc_msgSend_fixup_alloc in ResourcePath.o
  "_OBJC_CLASS_$_NSBundle", referenced from:
      objc-class-ref in ResourcePath.o
  "___CFConstantStringClassReference", referenced from:
      CFString in ResourcePath.o
ld: symbol(s) not found for architecture x86_64
 

So I add the Foundation.framework to the build, and it builds with no errors.
However it crashes on start with a dyld_fatal_error.
The console log is:

dyld: Symbol not found: _OBJC_CLASS_$_NSObject
  Referenced from: /Users/... .../Frameworks/sfml-window.framework/Versions/2.1.0/sfml-window
  Expected in: /usr/lib/libobjc.A.dylib
 in /Users/... .../Frameworks/sfml-window.framework/Versions/2.1.0/sfml-window


This is with SFML 2.1
I've tried fixing the working directoy in the scheme, ensured build target is 10.7, commented out all of main, tried adding CoreFoundation...

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Cannot get template project to run in Xcode
« Reply #1 on: September 11, 2013, 08:53:57 am »
I didn't test older version of Xcode. Try upgrading to 4.6. It's available for OS X 10.7 too.
SFML / OS X developer

tylermfdurden

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Cannot get template project to run in Xcode
« Reply #2 on: September 12, 2013, 02:41:47 am »
I updated and tried again... Same problem.
No matter what the build target or what frameworks I add, I get the same fail on start.
Here is the assembly:

Thread:
dyld`_dyld_start:
0x7fff5fc01028:  pushq  $0
0x7fff5fc0102a:  movq   %rsp, %rbp
0x7fff5fc0102d:  andq   $-16, %rsp
0x7fff5fc01031:  movq   8(%rbp), %rdi
0x7fff5fc01035:  movl   16(%rbp), %esi
0x7fff5fc01038:  leaq   24(%rbp), %rdx
0x7fff5fc0103c:  movq   214637(%rip), %r8         ; _dyld_start_static
0x7fff5fc01043:  leaq   -34(%rip), %rcx           ; _dyld_start
0x7fff5fc0104a:  subq   %r8, %rcx
0x7fff5fc0104d:  leaq   -4180(%rip), %r8
0x7fff5fc01054:  callq  0x7fff5fc0106e            ; dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*)
0x7fff5fc01059:  movq   %rbp, %rsp     ;<-- Thread 1: EXC_BREAKPOINT (code=EXC_I386_BPT,subcode0x0)
0x7fff5fc0105c:  addq   $16, %rsp
0x7fff5fc01060:  movq   $0, %rbp
0x7fff5fc01067:  jmpq   *%rax
0x7fff5fc01069:  nopl   (%rax)


Thread:
dyld`dyld_fatal_error:
0x7fff5fc0106c:  int3  
0x7fff5fc0106d:  nop    ;<--Thread 1: EXC_BREAKPOINT (code=EXC_I386_BPT,subcode0x0)


Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Cannot get template project to run in Xcode
« Reply #3 on: September 14, 2013, 02:12:56 pm »
I never had this error personally so I don't really know where to start.. Here are some things you can try :

 - install / update the Command Line Tools (from Xcode preference panel, in the download section).
 - create a new SFML project

Let me know if you find anything.
SFML / OS X developer