From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A9373BB81 for ; Sun, 12 Dec 2004 08:29:35 +0100 (CET) Received: from pd4mo3so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iBC7TYUB022216 for ; Sun, 12 Dec 2004 08:29:35 +0100 Received: from pd2mr4so.prod.shaw.ca (pd2mr4so-qfe3.prod.shaw.ca [10.0.141.107]) by l-daemon (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0I8L00I06M5A7V90@l-daemon> for caml-list@yquem.inria.fr; Sun, 12 Dec 2004 00:29:34 -0700 (MST) Received: from pn2ml9so.prod.shaw.ca ([10.0.121.7]) by pd2mr4so.prod.shaw.ca (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0I8L00ISHM5AV0N0@pd2mr4so.prod.shaw.ca> for caml-list@yquem.inria.fr; Sun, 12 Dec 2004 00:29:34 -0700 (MST) Received: from glek.net (S0106000795bd85bd.gv.shawcable.net [24.68.44.127]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003)) with ESMTP id <0I8L00B15M5AS6@l-daemon> for caml-list@yquem.inria.fr; Sun, 12 Dec 2004 00:29:34 -0700 (MST) Received: from [10.1.0.2] (vpn_client [10.1.0.2]) by glek.net (Postfix) with ESMTP id 4A7E74CB576 for ; Sat, 11 Dec 2004 23:29:33 -0800 (PST) Date: Sat, 11 Dec 2004 23:29:33 -0800 From: Taras Subject: ocamlopt and linking To: caml-list@yquem.inria.fr Message-id: <41BBF35D.9060809@shaw.ca> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Miltered: at concorde with ID 41BBF35E.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocamlopt:01 ocaml:01 htmlman:01 libasmrun:01 usr:01 lib:01 ocaml:01 -ldl:01 -lm:01 -lcurses:01 main':01 main':01 usr:01 lib:01 libasmrun:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=1.8 required=5.0 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST,FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: * Hi, 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 Here is a small testcase: http://glek.net/~taras/os.tar.bz2 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 /home/taras/tmp/ccWVigi0.o(.text+0x0): In function `main': : multiple definition of `main' /usr/lib/ocaml/libasmrun.a(main.o)(.text+0x0): first defined here /usr/bin/ld: Warning: size of symbol `main' changed from 39 in /usr/lib/ocaml/libasmrun.a(main.o) to 96 in /home/taras/tmp/ccWVigi0.o mod_from_ml.o(.text+0x584): In function `caml_curry6_5': : undefined reference to `caml_extra_params' mod_from_ml.o(.text+0x772): In function `caml_curry7_6': : undefined reference to `caml_extra_params' mod_from_ml.o(.text+0x77c): In function `caml_curry7_6': : undefined reference to `caml_extra_params' mod_from_ml.o(.text+0xd5e): In function `camlPervasives__min_49': : undefined reference to `caml_lessequal' mod_from_ml.o(.text+0xd9e): In function `camlPervasives__max_52': : undefined reference to `caml_greaterequal' mod_from_ml.o(.text+0x3144): In function `camlList__mem_185': : undefined reference to `caml_compare' mod_from_ml.o(.text+0x31da): In function `camlList__assoc_193': : undefined reference to `caml_compare' mod_from_ml.o(.text+0x32d6): In function `camlList__mem_assoc_203': : undefined reference to `caml_compare' mod_from_ml.o(.text+0x336d): In function `camlList__remove_assoc_213': : undefined reference to `caml_compare' mod_from_ml.o(.text+0x4893): In function `camlString__compare_176': : undefined reference to `caml_compare' mod_from_ml.o(.text+0x6a28): In function `camlPrintf__doprn_187': : undefined reference to `caml_extra_params' mod_from_ml.o(.text+0x6c08): In function `camlPrintf__doprn_224': : undefined reference to `caml_extra_params' mod_from_ml.o(.text+0x6d88): In function `camlPrintf__doprn_253': : undefined reference to `caml_extra_params' mod_from_ml.o(.text+0x72b3): In function `camlPrintf__scan_format_142': : undefined reference to `caml_extra_params' collect2: ld returned 1 exit status Thanks, Taras