[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2004-12-12 (09:04) |
From: | Xavier Leroy <Xavier.Leroy@i...> |
Subject: | Re: [Caml-list] ocamlopt and linking |
> I'm trying to link an ocamlopt-generated object file into a C program by > following instructions on http://caml.inria.fr/ocaml/htmlman/manual032.html > Currently it seems that main is already defined in libasmrun and some > symbols are missing from it. > cc -L /usr/lib/ocaml -lasmrun -ldl -lm -lcurses -o prog modwrap.o > mod_from_ml.o main.c You have a linking order problem. Remember that Unix linkers are *very* sensitive to the order of libraries on the command-line. (See the Info page for gcc, section "Options for linking", for more info.) Just put the libraries (-lxxx) last on the line and everything will work fine. - Xavier Leroy