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 RAA11381; Wed, 8 Sep 2004 17:50:45 +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 RAA17116 for ; Wed, 8 Sep 2004 17:50:44 +0200 (MET DST) Received: from mail.sgam.fr (hades.sgam.com [194.119.92.65]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i88FoiTI020240 for ; Wed, 8 Sep 2004 17:50:44 +0200 Received: from fr-mailcnx1.fr.sgam.socgen (mailcnx1 [10.15.1.6]) by mail.sgam.fr (8.12.10/8.12.10) with ESMTP id i88FoiqR009610 for ; Wed, 8 Sep 2004 17:50:44 +0200 (MEST) Received: by FR-MAILCNX1.fr.sgam.socgen with Internet Mail Service (5.5.2657.72) id ; Wed, 8 Sep 2004 17:50:54 +0200 Message-ID: <71A291D8E360AF4EA6FFFAF9CAD136CAF47E68@FR-MAILBOX2.fr.sgam.socgen> From: EL CHAAR RABIH To: EL IDRISSI ABDELLAH , "'caml-list@inria.fr'" Subject: RE: [Caml-list] problem while linking Date: Wed, 8 Sep 2004 17:51:21 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Miltered: at concorde with ID 413F2A54.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 passing:01 ocamlopt:01 stdlib:01 ocamlopt:01 -output-obj:01 libpath:01 libasmrun:01 2004:99 caml-list:01 -output-obj:01 libpath:01 libasmrun:01 frametable:01 decouvrez:99 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dear abdellah, i have already faced this problem and found a way to make things work. You are having conflicts with the names you are passing. The creation of object-files from the native compiler is rather tricky. My understanding is the following : if you compile a.ml with ocamlopt, two compilation phase are executed = (in windows at least) converting assembly code .asm into .obj you therefore have a.obj and a temporary file temp.obj These two files are put together using lib (along with stdlib.lib) in = order to create a.obj ?? My understanding is that the conflict comes here. If you specify a name = for the output-obj different then a.obj, then you will have no conflict. ocamlopt -output-obj -o test.obj exemple_ml.ml test.obj won't conflict with the existing exemple_ml.obj At linking, the command becomes LINK /LIBPATH:"C:\Program Files\Objective Caml\lib" /OUT:exec.exe libasmrun.lib exemple_c.obj test.obj Sincerely yours. Rabih PS: i suspect that the original link command refers to exemple_c.obj exemple_ml.obj and not twice exemple_ml.obj -----Message d'origine----- De : EL IDRISSI ABDELLAH [mailto:ABDELLAH.ELIDRISSI@sgam.com] Envoy=E9 : mercredi 8 septembre 2004 15:16 =C0 : 'caml-list@inria.fr' Objet : [Caml-list] problem while linking hello, I'm trying to add some ocaml code to an existing C application and I'm having problems linking the whole thing on Windows. Here's are the commands that I use to build the whole thing:=20 cl /c exemple_c.c ocamlopt -output-obj exemple_ml.ml LINK /LIBPATH:"C:\Program Files\Objective Caml\lib" /OUT:exec.exe libasmrun.lib exemple_ml.obj exemple_ml.obj And here are the link errors that result from the last command:=20 exemple_ml.obj : error LNK2001: unresolved external symbol _caml_curry2 libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _caml_exn_Failure libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _caml_exn_Invalid_argument libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _caml_bucket_Out_of_memory libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _caml_bucket_Stack_overflow libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _caml_exn_Sys_error libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _caml_exn_End_of_file libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _caml_exn_Division_by_zero libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _caml_exn_Not_found libasmrun.lib(fail.obj) : error LNK2001: unresolved external symbol _caml_exn_Sys_blocked_io libasmrun.lib(i386nt.obj) : error LNK2001: unresolved external symbol _caml_apply2 libasmrun.lib(i386nt.obj) : error LNK2001: unresolved external symbol _caml_apply3 libasmrun.lib(i386nt.obj) : error LNK2001: unresolved external symbol _caml_program libasmrun.lib(roots.obj) : error LNK2001: unresolved external symbol _caml_globals libasmrun.lib(roots.obj) : error LNK2001: unresolved external symbol _caml_frametable libasmrun.lib(startup.obj) : error LNK2001: unresolved external symbol _caml_code_segments libasmrun.lib(startup.obj) : error LNK2001: unresolved external symbol _caml_data_segments exec.exe : fatal error LNK1120: 17 unresolved externals ************************************************************************= * Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite.=20 Tout message electronique est susceptible d'alteration.=20 SG Asset Management et ses filiales declinent toute responsabilite au = titre de ce message s'il a ete altere, deforme ou falsifie. D=E9couvrez l'offre et les services de SG Asset Management sur le site www.sgam.fr=20 ******** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited.=20 E-mails are susceptible to alteration. =20 Neither SG Asset Management nor any of its subsidiaries or affiliates = shall be liable for the message if altered, changed or falsified.=20 ************************************************************************= * ------------------- 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 ************************************************************************= * Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite.=20 Tout message electronique est susceptible d'alteration.=20 SG Asset Management et ses filiales declinent toute responsabilite au = titre de ce message s'il a ete altere, deforme ou falsifie. D=E9couvrez l'offre et les services de SG Asset Management sur le site www.sgam.fr=20 ******** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited.=20 E-mails are susceptible to alteration. =20 Neither SG Asset Management nor any of its subsidiaries or affiliates = shall be liable for the message if altered, changed or falsified.=20 ************************************************************************= * ------------------- 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