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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:11:20+00:00 2026-06-01T18:11:20+00:00

In the same vein of using: ocamlc -i foo.ml to generate the default signature

  • 0

In the same vein of using:

ocamlc -i foo.ml  

to generate the default signature for foo.ml is there a way to generate signatures from compiled files (*.cmo) or archives (*.cma)?

My use case is that I have an archive abcd.cma I want to link with, containing numerous modules (say, modules a, b, c and d) and I don’t want to bother with the multiple *.mli and *.cmi my Makefile would need to handle to compile and link the user-side code (that uses the library). E.g. say I have file uses_a.ml that uses only the a module found in the abcd.cma archive. My understanding is that to link with the abcd.cma module I would have to go through the following motions:

ocamlc -i a.ml > a.mli
ocamlc -c a.mli
ocamlc -c uses_a.ml  
ocamlc abcd.cma uses_a.cmo

Which seems too convoluted or impossible if I don’t have access to the sources or the signature. Given that I provide the entire archive to the compiler at the last command it is not clear to me why I have to go through the ritual of compiling (or generating – if I have access to the sources) the specific signature file for the module I am using. The last command could have been interpreted by the tool as an invitation to use the “default” signature of any module present in the archive that subsequent modules on the line use. BTW I don’t want to use automatic Makefile generation tools at this point.

  • 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-06-01T18:11:22+00:00Added an answer on June 1, 2026 at 6:11 pm

    If you have to compile a.ml and a.mli, there is no point having a library.

    A library is normally composed of a abcd.cma file (or both abcd.a and abcd.cmxa in native code) and the set of interfaces (.cmi files) of the modules that are exported from the library. So, normally, in your case, the file a.cmi should be provided altogether with the library.

    In such a case, you just need to do:

     ocamlc -I path/to/directory/containing_a.cmi -c uses_a.ml
     ocamlc -o program.opt abcd.cma uses_a.cmo
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The same way i use this to detect when user scolled down the whole
Same question as this , however the solution there didn't work. I set these
I created a Hello World application, in the same vein as http://giantflyingsaucer.com/blog/?p=409 . It
Huh. In the same vein as Viewing Content Of Blob In phpMyAdmin , i
Is there a way to limit both the number of cores that java uses?
It doesn't seem like there is an obvious to implement databinding using jQuery or
I am working on a building game (in the same vein as MineCraft, Roboblox
Along the same vein as the questions asked yesterday, I have another count if
In the same vein as Quickly create a large file on a Linux system
Same as the title and using C#. Anyone know how to do this? I

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.