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 6718901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:01:46+00:00 2026-05-26T09:01:46+00:00

if i have written a library in C++, and have bindings for C, Ada,

  • 0

if i have written a library in C++, and have bindings for C, Ada, Fortran, D & other compiled languages.

could all these bindings be in the same binary with the C++ compiled code even if they use the same function names?

and could you use the bindings like this?

  • 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-26T09:01:46+00:00Added an answer on May 26, 2026 at 9:01 am

    Depending how you create your bindings a library may not be even necessary:

    • Bindings written some interpreter specific APIs:

    For example, ruby extensions written using the MRI API, are basically a shared library providing a:

    void init_Modulename()
    

    This function then uses the MRI api like rb_define_module, rb_define_class, rb_define_method, etc to wrap the C/C++ APIs. Make sure this function is surrounded by extern “C” so it’s name does not get mangled in the C++ way.

    Normally this shared library goes linked against the library you are binding, but nothing prevents that they are the same shared library.

    • Bindings done at runtime

    For example bindings using FFI on Ruby and other interpreters. The bindings get defined in the same language and it is the FFI library that knows how to call the methods in the target library at runtime. Therefore in this case the bindings themselves have no “library”.

    • Bindings done with generators

    If you use a generator, like SWIG, it will scan the library headers and generate the bindings for various languages. Depending on how those targets are implemented by the SWIG generator (for example, for Ruby uses the MRI API described above) then SWIG will create code you can compile into its own library, but as long as you don’t have symbol conflicts, you could as well compile this together with your library.

    When I mean symbol conflicts, I don’t mean the API itself, but the binding helpers, like init_Modulename().

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

Sidebar

Related Questions

I have compiled a library(GDAL) written in C/C++ with Ruby bindings. After a ran
Have written all the code in a silverlight class library (dll) and linked this
I have written a c++ library, and I'm trying to make python bindings to
I have a java compiled library in a jar.for which i have written documentation
I have written a library that exposes references to several related object types. All
I have written a Flex Library project - a .swc file - which is
I have a library written in C that I would like to use in
I have written a C# class library (DLL) and wondering the quickest way to
I have a library written in C++/CLI and I want to open it up.
I have a common comms library that i have written to communicate with our

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.