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
[Caml-list] -custom and C libraries
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-14 (15:35)
From: Wolfgang Lux <wlux@u...>
Subject: Re: [Caml-list] -custom and C libraries
Ohad Rodeh wrote

> For example, I could not do :
>     ocamlc -custom -o test_prog   libX.a libY.a intf.o X.cmo Y.cmo
> But if I opened libX.a and libY.a into their component object files, 
> things
> worked
> great.
> Has anybody had the same problems, or am I overlooking the obvious?

Yes :-) For most platforms[1] the order of files on the command line is 
Archive members are included in the link only if they can be used to
resolve open references for those files which preceed them on the command
line. In your example, there are no objects specified before the archives
and they aren't used for that reason. The following command should do
the job.

   ocamlc -custom -o test_prog intf.o X.cmo Y.cmo  libX.a libY.a


[1] IBM's AIX linker is one of the notable exceptions, AFAIR.

Wolfgang Lux                              Phone: +49-251-83-38263
Institut fuer Wirtschaftinformatik          FAX: +49-251-83-38259
Universitaet Muenster                 Email:

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: