-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to generate a shared libray from C and ML code? #267
Comments
To build a dynamic library, the target-naming convention is that you should build If you find yourself confused about ocamlbuild build rules, you could consider using |
Thanks for the help! The advanced targets section could be improved (I'm happy to offer a pull-request if you welcome contributions). Table 6 is a bit confusing to meTable 6 is confusing to browse because it appears to be listing sometimes the inputs and sometimes the outputs (aka targets) of OCB (contrast this to Table 4 that only lists the outputs). I finding listing the outputs more intuitive, as it is usually what one is looking for (How do I invoke OCB?) Suggestions
Examples of inconsistencies follow. In the row
The extension The row
Lists the input and does not list the output. In row
We have one input The documentation for clib files in
|
Again, @gasche, I am happy to submit patches for either problem. And very importantly, let me also thank you for the wonderful work you've put in the tool and in the documentation. In my opinion, OCB is a great example of an OCaml project done right, especially because of its great documentation. |
Thanks! Those are excellent comments, and (of course ?) I would be happy to receive contributions. Regarding documentation output:
Regarding the manual: I hadn't thought about it this way (about the confusion between "inputs" and "outputs"), that's a great perspective! I see that other figures in 2.2 are guilty of this as well. (For example Table 4 lists Let me first explain how the current state came to be. Mixing inputs and outputs makes some sense from a conceptual point of view because to ocamlbuild there is no difference, they are all "targets". A rule can build a target from another target (so from the rule perspective one is output and one is output), but users can add new rules to turn things that were previously inputs into outputs; for example, a On the other hand, I agree with you that this is confusing to the user. We could try to point out more explicitly which targets are generally outputs and which are generally inputs, and also not mix inputs and outputs of a rule together without saying anything. It is not completely clear to me what's a good way to give this information (or hint at this common structure) in a way that clears the confusion away without being too heavy-handed. Do you have suggestions? |
Hi, everyone,
I am a bit confused when trying to generate a dynamic library (shared object).
I expected this to be done by creating a
.clib
file listing the object files (one per line).When I do
ocamlbuild libproj.so
I get the following error message:Should I be generating a shared library with a
.clib
file? Any help on what I am missing?The text was updated successfully, but these errors were encountered: