From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA31013; Wed, 2 Jul 2003 23:48:30 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA31056 for ; Wed, 2 Jul 2003 23:48:29 +0200 (MET DST) Received: from hotmail.com (bay1-f54.bay1.hotmail.com [65.54.245.54]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h62LmSf12015 for ; Wed, 2 Jul 2003 23:48:28 +0200 (MET DST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 2 Jul 2003 14:48:26 -0700 Received: from 128.2.71.93 by by1fd.bay1.hotmail.msn.com with HTTP; Wed, 02 Jul 2003 21:48:26 GMT X-Originating-IP: [128.2.71.93] X-Originating-Email: [unosoft@hotmail.com] From: "Jung Woon Ho" To: caml-list@inria.fr Cc: unosoft@hotmail.com Subject: [Caml-list] Question in Linking C and Ocaml Date: Wed, 02 Jul 2003 21:48:26 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 02 Jul 2003 21:48:26.0966 (UTC) FILETIME=[AB261760:01C340E3] X-Spam: no; 0.00; jung:99 ocamlopt:01 -output-obj:01 filenames:01 gcc:01 ocamlc:01 sched:01 ranlib:01 usr:01 -dhave:01 -lm:01 -ldl:01 fib':01 string':01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, Im trying to link some Ocaml files to my C program. And I'm having difficulties in liking them together. here is what I do.... 1) compile all my Ocaml src code with the following command. ocamlopt -c -output-obj 2) compile my C file using GCC (obtain object files) 3) compile my C file that calls the OCAML function with ocamlc -c (obtain object files) ar -rv sched.a mod.a and all the object files produced above. (obtain sched.a) 4) ranlib sched.a 5) finally in the main Makefile when I try to link the sched.a (produced above) using g++ -L/usr/include -O3 -DHAVE_CONFIG_H myfiles.o sched/sched.a -lncurses -lm -ldl Gives me the following errors: sched/sched.a(modwrap.o)(.text+0x27): In function `fib': : undefined reference to `caml_named_value' sched/sched.a(modwrap.o)(.text+0x42): In function `fib': : undefined reference to `copy_string' sched/sched.a(modwrap.o)(.text+0x53): In function `fib': : undefined reference to `callback' sched/sched.a(modwrap.o)(.text+0x88): In function `format_result': : undefined reference to `caml_named_value' sched/sched.a(modwrap.o)(.text+0xab): In function `format_result': : undefined reference to `callback' collect2: ld returned 1 exit status I tried different variations of what I explainded above and I cant get it to link together. Can somebody help me with this? This is my second day stuck with this problem, any kind of help will be greatly apreciated. thank you very much. _________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus ------------------- 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