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

Author Topic: [C++/OSX] libraries don't link properly  (Read 5138 times)

0 Members and 1 Guest are viewing this topic.

zhinchliffe

  • Newbie
  • *
  • Posts: 18
    • View Profile
[C++/OSX] libraries don't link properly
« on: January 03, 2009, 12:16:46 am »
I am attempting to build a friend's SFML game on the Mac OS X platform, and am having a bit of trouble. I start a new Xcode project from the Xcode templates included with the SFML download. It builds and runs fine. But then, when I change the main.cpp into the one for my friend's game, the built application will not fully launch. GDB tells me (see bottom of post) the application cannot load the SFML frameworks from the Frameworks directory of the app bundle, and sure enough, no Frameworks (or Resources) directories have been created, even though Xcode says it built properly. What would be the cause of this? I'm not positive if my friend wants me to share the source, but I'm just wondering if there's anything that can be put in main.cpp that'd disable the proper linking of the libraries?

And, furthermore, when I put the libraries manually into the Frameworks folder, it still doesn't load. What's up with that?

Code: [Select]
warning: Unable to read symbols for "@executable_path/../Frameworks/sfml-audio-d.framework/Versions/A/sfml-audio-d" (file not found).
warning: Unable to read symbols from "sfml-audio-d" (not yet mapped into memory).
warning: Unable to read symbols for "@executable_path/../Frameworks/sfml-graphics-d.framework/Versions/A/sfml-graphics-d" (file not found).
warning: Unable to read symbols from "sfml-graphics-d" (not yet mapped into memory).
warning: Unable to read symbols for "@executable_path/../Frameworks/sfml-system-d.framework/Versions/A/sfml-system-d" (file not found).
warning: Unable to read symbols from "sfml-system-d" (not yet mapped into memory).
warning: Unable to read symbols for "@executable_path/../Frameworks/sfml-window-d.framework/Versions/A/sfml-window-d" (file not found).
warning: Unable to read symbols from "sfml-window-d" (not yet mapped into memory).

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
[C++/OSX] libraries don't link properly
« Reply #1 on: January 03, 2009, 12:47:30 am »
The debugger asks for the frameworks to be copied in appname.app/Contents/Frameworks. Make sure this is where you put them.

Otherwise, for general development with SFML, the frameworks must be copied in /Library/Frameworks.
Want to play movies in your SFML application? Check out sfeMovie!

zhinchliffe

  • Newbie
  • *
  • Posts: 18
    • View Profile
[C++/OSX] libraries don't link properly
« Reply #2 on: January 03, 2009, 01:59:40 am »
Quote from: "Ceylo"
The debugger asks for the frameworks to be copied in appname.app/Contents/Frameworks. Make sure this is where you put them.

Otherwise, for general development with SFML, the frameworks must be copied in /Library/Frameworks.
right, but usually the frameworks are automatically put in that folder, and now, for some reason, they are not.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
[C++/OSX] libraries don't link properly
« Reply #3 on: January 03, 2009, 04:53:53 pm »
Quote from: "zhinchliffe"
right, but usually the frameworks are automatically put in that folder, and now, for some reason, they are not.

Never has this been done automatically.

If you wish Xcode to do this for you, use a build phase (Xcode Build System Guide).
Want to play movies in your SFML application? Check out sfeMovie!

zhinchliffe

  • Newbie
  • *
  • Posts: 18
    • View Profile
[C++/OSX] libraries don't link properly
« Reply #4 on: January 03, 2009, 06:40:21 pm »
Quote from: "Ceylo"
Never has this been done automatically.
but when I compile the basic included SFML template, it DOES do it automatically.  :?

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
[C++/OSX] libraries don't link properly
« Reply #5 on: January 03, 2009, 07:13:09 pm »
Not with the latest versions of the templates, because I consider this is rather an advanced step, and therefore is not required for SFML development.


But if you use the old templates... I do not understand why you can't find the frameworks in the <name>.app/Contents/Frameworks directory :? .

Whatever the debugger tells you, if you copy the right frameworks in /Library/Frameworks, you application or executable will work fine.
Want to play movies in your SFML application? Check out sfeMovie!

zhinchliffe

  • Newbie
  • *
  • Posts: 18
    • View Profile
[C++/OSX] libraries don't link properly
« Reply #6 on: January 03, 2009, 10:38:25 pm »
okay, now when I put the files in there, the application stalls for a bit and crashes.  :(

do you think we could talk about this on an instant messenger so I could get this problem figured out a bit faster? i've listed my contact details below:

AIM: zachhinchliffe
YAHOO: zachhinchliffe
MSN/WLM: zhinchliffe@isamedia.org
Google Talk: zhinchliffe@gmail.com
Skype: zachhinchliffe

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
[C++/OSX] libraries don't link properly
« Reply #7 on: January 04, 2009, 12:29:41 am »
What's written in the Xcode's console ?
Want to play movies in your SFML application? Check out sfeMovie!

zhinchliffe

  • Newbie
  • *
  • Posts: 18
    • View Profile
[C++/OSX] libraries don't link properly
« Reply #8 on: January 04, 2009, 01:08:26 am »
Quote from: "Ceylo"
What's written in the Xcode's console ?


Code: [Select]
[Session started at 2009-01-03 19:08:10 -0500.]
Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/zhinchliffe/Desktop/Coobie and the Robots/build/Release/Coobie and the Robots.app/Contents/MacOS/Coobie and the Robots', process 5549.
(gdb)

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
[C++/OSX] libraries don't link properly
« Reply #9 on: January 04, 2009, 01:16:22 am »
There is no crash described in this log.

PS: you can come and talk through MSN.
Want to play movies in your SFML application? Check out sfeMovie!

zhinchliffe

  • Newbie
  • *
  • Posts: 18
    • View Profile
[C++/OSX] libraries don't link properly
« Reply #10 on: January 04, 2009, 01:21:23 am »
hmm.... now it just hangs... even though I didn't change anything. argh!

EDIT: also, what's your MSN address?