Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
ocamlopt, .cmxa and "not a compilation unit description" error Options
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-06-10 (18:15)
From: Charles Hymans <charles.hymans@g...>
Subject: ocamlopt, .cmxa and "not a compilation unit description" error Options

I'd like to generate a library from a file that uses the nums library
(in a way such that the final user of my library does not have to
specify that nums is necessary).

I was able to generate a .cma with the following command:
ocamlc -a nums.cma -o lib.cma

However to generate a .cmxa, the command:
ocamlopt -a nums.cmxa -o lib.cmxa

fails and reports the error that "nums.cmxa is not a compilation unit

I can always do:
ocamlopt -a -o lib.cmxa

But the user of my library will have to necessarily specify nums.cmxa
when compiling his project.
Is there a way to go around this? (for instance, by putting the option
nums.cmxa into the library?)

Thank you.