Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

creating a .dll on a mac: .dylib or framework?

I need to create a Mac version of our libraries for one of our customers. I am not so familiar with dynamic libraries on Mac, but from what I understand, I have 2 options: .dylib or frameworks. What would be the best option? Why?

Few related questions:

  • If I understand correctly, .dylib have to be installed in one of the stnadard UNIX directories such as /usr/lib, etc. Hence using a .dylib should make my customer's installer much more complex, since they'll probably need to request permission to write something in a system folder?
  • Can frameworks be private and embedded within my customer's bundle? So no one else can see/use them?

Any constructive criticisms/comments/ideas more than welcome. Thanks in advance.

Alex

like image 675
vectorizor Avatar asked Jul 31 '09 13:07

vectorizor


People also ask

What are Framework files Mac?

A framework is a hierarchical directory that encapsulates shared resources, such as a dynamic shared library, nib files, image files, localized strings, header files, and reference documentation in a single package. Multiple applications can use all of these resources simultaneously.

How do I find Dylib on Mac?

The standard locations for dynamic libraries are ~/lib , /usr/local/lib , and /usr/lib . You may also place the . dylib file at a nonstandard location in your file system, but you must add that location to one of these environment variables: LD_LIBRARY_PATH.


1 Answers

.dylib is similar to .so on Linux.

Frameworks are basically just the OSX way of distributing libraries and headers together. They are the Application Bundle equivalent for library distribution.

With either method if you want to ensure other people don't use them you should be using static libraries (.a files) and getting your customer to statically link them into their application.

Otherwise there isn't really much difference between Frameworks and .dylib except the prior is nicer for OSX developers.

Either can be embedded inside a customers Application bundle, otool/install_name_tool handle them both fine.

like image 71
Mike McQuaid Avatar answered Sep 22 '22 10:09

Mike McQuaid