* [Caml-list] -custom and C libraries
@ 2002-08-14 14:29 Ohad Rodeh
2002-08-14 15:35 ` Wolfgang Lux
0 siblings, 1 reply; 2+ messages in thread
From: Ohad Rodeh @ 2002-08-14 14:29 UTC (permalink / raw)
To: caml-list
List,
I have just spent several hours trying to convince ocamlc (and ocamlopt)
to
link together several cmo files and C libraries and objects. It turned out
that
I could only link them together if all the C files were compiled into
objects, and not
linked together into intermediate libraries.
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?
Ohad.
-----------------------------------------------------------------------------------
Ohad Rodeh
tel: +972-3-6401641
IBM Haifa, storage research
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] -custom and C libraries
2002-08-14 14:29 [Caml-list] -custom and C libraries Ohad Rodeh
@ 2002-08-14 15:35 ` Wolfgang Lux
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Lux @ 2002-08-14 15:35 UTC (permalink / raw)
To: Ohad Rodeh; +Cc: caml-list
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
relevant.
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
Wolfgang
[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: wlux@uni-muenster.de
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-08-14 15:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-14 14:29 [Caml-list] -custom and C libraries Ohad Rodeh
2002-08-14 15:35 ` Wolfgang Lux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox