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

Author Topic: [SFML 2.0 / OSX Lion] Errors when linking  (Read 3053 times)

0 Members and 1 Guest are viewing this topic.

krslynx

  • Newbie
  • *
  • Posts: 1
    • AOL Instant Messenger - krslynx
    • View Profile
    • http://krslynx.com
[SFML 2.0 / OSX Lion] Errors when linking
« on: December 18, 2011, 02:28:30 pm »
Hi,

I was directed here after posting this question on StackOverflow: http://stackoverflow.com/questions/8546877/sfml-linker-errors-on-os-x

I have tried to get both SFML 1.6 and SFML 2.0 working with a game I am working on, however I get a lot of linker errors when trying to compile. To briefly summarise my build process I do the following:

For 1.6: Copy the SFML.framework and other *.framework folders over to /Library/Frameworks - then, in my XCode project I am able to complete all of the necessary includes. The compilation process fails however when it comes to linking, where just about every call I make to SFML fails.

When I figured it could have been because I was using Lion, I downloaded the 2.0 version - configured and generated the Unix makefiles with CMake (pointing to my X11RC freetype dylib) and compiled - the frameworks were generated as well as the examples.

However, after moving the frameworks over to /Library/Frameworks I had the same linker errors as on 1.6.

I noticed that there was another part of the tutorial that involved moving some example XCode projects over ~ however as I understood it (perhaps naively) they were not a necessity for getting SFML to work. I didn't want to move them over as I am only trying out SFML while trying to weigh out my options of either SFML or SDL for my videogame.

Perhaps I should be adding something else to the linker settings? I have pretty much no experience on OSX.

Thank you very much for your time and help! SFML looks extremely promising!

EDIT:

So I spent a little more time, and compiled the 2.0 Frameworks. In XCode I then placed the CMake build directory into the 'Frameworks Search Paths' under 'Build Settings -> Search Paths' which allowed me to search for SFML.framework without having to place it into my /Library/Frameworks folder. When trying to compile, I still got linker errors however if I drag and drop the other frameworks (sfml-audio.framework ... etc) into the Build Phases -> Link Binary with Libraries box I could compile without linker issues.

Unfortunately my output is:

Code: [Select]

There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys001
warning: Unable to read symbols for @executable_path/../Frameworks/SFML.framework/Versions/2.0.0/SFML (file not found).
warning: Unable to read symbols from "SFML" (not yet mapped into memory).
warning: Unable to read symbols for @executable_path/../Frameworks/sfml-audio.framework/Versions/2.0.0/sfml-audio (file not found).
warning: Unable to read symbols from "sfml-audio" (not yet mapped into memory).
warning: Unable to read symbols for @executable_path/../Frameworks/sfml-graphics.framework/Versions/2.0.0/sfml-graphics (file not found).
warning: Unable to read symbols from "sfml-graphics" (not yet mapped into memory).
warning: Unable to read symbols for @executable_path/../Frameworks/sfml-network.framework/Versions/2.0.0/sfml-network (file not found).
warning: Unable to read symbols from "sfml-network" (not yet mapped into memory).
warning: Unable to read symbols for @executable_path/../Frameworks/sfml-system.framework/Versions/2.0.0/sfml-system (file not found).
warning: Unable to read symbols from "sfml-system" (not yet mapped into memory).
warning: Unable to read symbols for @executable_path/../Frameworks/sfml-window.framework/Versions/2.0.0/sfml-window (file not found).
warning: Unable to read symbols from "sfml-window" (not yet mapped into memory).
[Switching to process 51939 thread 0x0]
dyld: Library not loaded: @executable_path/../Frameworks/SFML.framework/Versions/2.0.0/SFML
  Referenced from: /Users/chris/Library/Developer/Xcode/DerivedData/XCode-ghnwhzthkgqaznevciahhiiulwdw/Build/Products/Debug/XCode
  Reason: image not found


Fixed:

1. Re-configured using CMake.
2. Re-compiled the frameworks using 'make'.
3. Ran 'sudo make install' to install the frameworks'.
4. Searched for the SFML framework, and added it.
5. Drag 'n' Dropped the other frame works into the 'Link Binary with Libraries' field. (or I still got linker errors?)
6. It worked.

Still get these errors, however:

Code: [Select]

warning: Unable to read symbols for @executable_path/../Frameworks/SFML.framework/Versions/2.0.0/SFML (file not found).
warning: Unable to read symbols from "SFML" (not yet mapped into memory).
warning: Unable to read symbols for @executable_path/../Frameworks/sfml-audio.framework/Versions/2.0.0/sfml-audio (file not found).
warning: Unable to read symbols from "sfml-audio" (not yet mapped into memory).
warning: Unable to read symbols for @executable_path/../Frameworks/sfml-graphics.framework/Versions/2.0.0/sfml-graphics (file not found).
warning: Unable to read symbols from "sfml-graphics" (not yet mapped into memory).
warning: Unable to read symbols for @executable_path/../Frameworks/sfml-network.framework/Versions/2.0.0/sfml-network (file not found).
warning: Unable to read symbols from "sfml-network" (not yet mapped into memory).
warning: Unable to read symbols for @executable_path/../Frameworks/sfml-system.framework/Versions/2.0.0/sfml-system (file not found).
warning: Unable to read symbols from "sfml-system" (not yet mapped into memory).
warning: Unable to read symbols for @executable_path/../Frameworks/sfml-window.framework/Versions/2.0.0/sfml-window (file not found).
warning: Unable to read symbols from "sfml-window" (not yet mapped into memory).

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
[SFML 2.0 / OSX Lion] Errors when linking
« Reply #1 on: December 18, 2011, 10:04:40 pm »
These warning are emitted when you're using the frameworks in an command line application (i.e., not a application bundle ".app").

You can use the provided templates (see this post for pretty much all the available informations) to create your own application bundle.

The templates will copy all the required frameworks in the correct folder, making your application ready for the "drag'n'drop installation" by the end user.
SFML / OS X developer

 

anything