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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Keybounce

Pages: [1]
1
General discussions / Linking problem, Mac 10.5.8 SFML 1.6
« on: June 23, 2010, 10:25:27 pm »
Ahh. Thank you.

That is a tool (install_name_tool) that I had never seen mentioned before, nor the idea that a library/framework includes a "Where to find me" separate from its actual location.

As for the "Frameworks" section of a bundle, I thought that magic was done by the dynamic linker, and not by hardcoding a "relative" pathname in anything.

====

There is a option to ld that actually does what I want:
Code: [Select]

   -dylib_file install_name:file_name
                 Specifies that a dynamic shared library is in a different
                 location than its standard location. Use this option when you
                 link with a library that is dependent on a dynamic library,
                 and the dynamic library is in a location other than its
                 default location. install_name specifies the path where the
                 library normally resides. file_name specifies the path of the
                 library you want to use instead. For example, if you link to
                 a library that depends upon the dynamic library libsys and
                 you have libsys installed in a nondefault location, you would
                 use this option: -dylib_file /lib/lib-
                 sys_s.A.dylib:/me/lib/libsys_s.A.dylib.

This is what I thought was default behavior, but has to be specified.
I would not have found this without your hint about install_name_tool

---
So I think my final solution will be to put it into /Library, and leave /opt to MacPorts.

2
General discussions / Linking problem, Mac 10.5.8 SFML 1.6
« on: June 23, 2010, 06:08:21 pm »
Quote from: "Ceylo"
Even if linking succeeds, when launching your app, Mac OS X cannot automatically find the SFML frameworks in the directory you're using.


That's odd. otool -L reports some absolute pathnames for frameworks.

... Hmm, it seems to have absolutes for system frameworks and any dynamic library, but not for user frameworks.

Alright, why did Apple make that sort of limitation in the framework linking? Never mind.

(Expecting that everyone will ship the frameworks that they use, to prevent versioning issues? Well, fine, but that doesn't explain why the dynamic libraries can be hardcoded.)

3
General discussions / Linking problem, Mac 10.5.8 SFML 1.6
« on: June 22, 2010, 08:58:07 pm »
I am having trouble getting an SMFL program to link when compiled from source.

The program is Vba-M. It is the first Cmake based program I've worked with.

The final linking stage has this command:

/usr/bin/c++   -O3 -Wall -Wl,-search_paths_first -headerpad_max_install_names  CMakeFiles/vbam.dir/src/sdl/debugger.o CMakeFiles/vbam.dir/src/sdl/SDL.o CMakeFiles/vbam.dir/src/sdl/dummy.o CMakeFiles/vbam.dir/src/sdl/filters.o CMakeFiles/vbam.dir/src/sdl/text.o CMakeFiles/vbam.dir/src/sdl/inputSDL.o CMakeFiles/vbam.dir/src/common/SoundSDL.o CMakeFiles/vbam.dir/src/sdl/expr.o CMakeFiles/vbam.dir/src/sdl/exprNode.o CMakeFiles/vbam.dir/src/sdl/expr-lex.o CMakeFiles/vbam.dir/src/filters/hq/c/hq_implementation.o  -o vbam  -L/opt/local/lib -F/opt/local/Library/Frameworks libvbamcore.a -lSDLmain /opt/local/lib/libSDL.dylib -framework Cocoa /usr/lib/libz.dylib /opt/local/lib/libpng.dylib -framework AGL -framework OpenGL -framework sfml-system -framework sfml-audio -framework sfml-graphics -framework sfml-network -framework sfml-window libfex.a -framework SFML



That has an "-F/opt/local/Library/Frameworks". That's where the SFML libraries are located.

Running it gives this error:

Kleiman-ibook:trunk michael$ ./vbam
dyld: Library not loaded: @executable_path/../Frameworks/sfml-system.framework/Versions/A/sfml-system
  Referenced from: /Volumes/Michael/Documents/Development/vbam/trunk/./vbam
  Reason: image not found
Trace/BPT trap

What do I need to do to link an SFML application on the Mac?

10.5.8, PPC. Universal 32 bit binary image downloaded.

(See also: http://vba-m.com/forum/compiling-on-mac-os-x-t-436.html#pid3712 )

Pages: [1]
anything