Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6840373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:50:09+00:00 2026-05-26T23:50:09+00:00

My C++ compiler creates dylib files which contain dynamic libraries. Whats the difference between

  • 0

My C++ compiler creates “dylib” files which contain dynamic libraries. Whats the difference between .dylib and .so files?

And what is the difference between files in Mach-O format and files in an ELF format? I have to build files for later use under iOS (static libraries only/Mach-O) and Android (ELF).

Thanx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:50:10+00:00Added an answer on May 26, 2026 at 11:50 pm

    I found that:

    One Mach-O feature that hits many people by surprise is the strict
    distinction between shared libraries and dynamically loadable modules.
    On ELF systems both are the same; any piece of shared code can be used
    as a library and for dynamic loading. Use otool -hv some_file to see
    the filetype of some_file.

    Mach-O shared libraries have the file type MH_DYLIB and carry the
    extension .dylib. They can be linked against with the usual static
    linker flags, e.g. -lfoo for libfoo.dylib. However, they can not be
    loaded as a module. (Side note: Shared libraries can be loaded
    dynamically through an API. However, that API is different from the
    API for bundles and the semantics make it useless for an dlopen()
    emulation. Most notably, shared libraries can not be unloaded.) [This
    is no longer true—you can use dlopen() with both dylibs and bundles.
    However, dylibs still can’t be unloaded.]

    Loadable modules are called “bundles” in Mach-O speak. They have the
    file type MH_BUNDLE. Since no component involved cares about it, they
    can carry any extension. The extension .bundle is recommended by
    Apple, but most ported software uses .so for the sake of
    compatibility. Bundles can be dynamically loaded and unloaded via dyld
    APIs, and there is a wrapper that emulates dlopen() on top of that
    API. [dlopen is now the preferred API.] It is not possible to link
    against bundles as if they were shared libraries. However, it is
    possible that a bundle is linked against real shared libraries; those
    will be loaded automatically when the bundle is loaded.

    To compile a normal shared library on OS X, you should use -dynamiclib
    and the extension .dylib. -fPIC is the default.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that C++ compiler creates a copy constructor for a class. In which
I have some code which creates a synchronised queue which I use in a
I need to create a program that creates another program but not a compiler
I have different behaviour of compiler, when building project from IDE and from command-line,
So I have included the libxml2.2.dylib library into my iPhone XCode project to create
Everywhere i read, if no destructor is defined the compiler creates one anyway. So
mono creates its own debug targets called .mdb files when you use the mcs
The following line of code, which creates a variable-length array on the stack: char
Sometimes I have need to call namespace and class the same. For example, SomeProject.Compiler
I have a class which accumulates information about a set of objects, and can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.