Hi Nico,
    I'm also posting this to media_api to solicit other ideas. Here's 
the problem...

I've been working on portmidi and discovered (yet another) configuration 
issue. It's not particular to portmidi, but I'm not sure how people 
normally deal with this...

If I build both  dynamic (libportmidi.dylib) and static (libportmidi.a) 
libraries, they go into some directory, e.g. 
portmidi/Release/libportmidi.dylib and portmidi/Release/libportmidi.a.

Now, suppose I want a project to link with the static version. To get 
the library, the linker command is: ld .... -LRelease .... -lportmidi
where -L gives the search path and -l gives the library name. If there 
is only a static library, -lportmidi will find libportmidi.a and it is 
linked as desired. However, if there are both static and dynamic 
versions, -lportmidi will find libportmidi.dylib (a preference built 
into ld) instead of libportmidi.a. There are some indirect ways to get 
the right library, e.g. access through uniquely named symbolic links and 
use -Bstatic directives in the linker line (seems tricky to manage when 
using Xcode, CMake, or automake).

My proposal is make library flavors explicit, e.g. libportmidi_s.a and 
libportmidi_d.dylib, but I would like to hear any other suggestions.

-Roger

_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api

Reply via email to