Browse thread
RE: [Caml-list] problem while linking
- EL CHAAR RABIH
[
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-09-08 (15:50) |
From: | EL CHAAR RABIH <RABIH.EL-CHAAR@s...> |
Subject: | RE: [Caml-list] problem while linking |
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é : mercredi 8 septembre 2004 15:16 À : '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: 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: 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. Tout message electronique est susceptible d'alteration. SG Asset Management et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. Découvrez l'offre et les services de SG Asset Management sur le site www.sgam.fr ******** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SG Asset Management nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. ************************************************************************* ------------------- 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. Tout message electronique est susceptible d'alteration. SG Asset Management et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. Découvrez l'offre et les services de SG Asset Management sur le site www.sgam.fr ******** This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SG Asset Management nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. ************************************************************************* ------------------- 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