caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* RE: [Caml-list] problem while linking
@ 2004-09-08 15:51 EL CHAAR RABIH
  0 siblings, 0 replies; 3+ messages in thread
From: EL CHAAR RABIH @ 2004-09-08 15:51 UTC (permalink / raw)
  To: EL IDRISSI ABDELLAH, 'caml-list@inria.fr'

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] problem while linking
  2004-09-08 13:15 EL IDRISSI ABDELLAH
@ 2004-09-08 23:33 ` Nathaniel Gray
  0 siblings, 0 replies; 3+ messages in thread
From: Nathaniel Gray @ 2004-09-08 23:33 UTC (permalink / raw)
  To: EL IDRISSI ABDELLAH; +Cc: caml-list

I'm pretty sure this is a case where you've built part of your program
with ocaml 3.08 but you're linking against libraries from ocaml 3.07. 
Some functions were renamed in between these versions.  Try rebuilding
your entire project, and make sure you don't have any old libraries
from 3.07 lying around.

On Wed, 8 Sep 2004 15:15:36 +0200, EL IDRISSI ABDELLAH
<abdellah.elidrissi@sgam.com> wrote:

> 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
> [snip]
-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->

-------------------
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Caml-list] problem while linking
@ 2004-09-08 13:15 EL IDRISSI ABDELLAH
  2004-09-08 23:33 ` Nathaniel Gray
  0 siblings, 1 reply; 3+ messages in thread
From: EL IDRISSI ABDELLAH @ 2004-09-08 13:15 UTC (permalink / raw)
  To: 'caml-list@inria.fr'

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-08 23:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-08 15:51 [Caml-list] problem while linking EL CHAAR RABIH
  -- strict thread matches above, loose matches on Subject: below --
2004-09-08 13:15 EL IDRISSI ABDELLAH
2004-09-08 23:33 ` Nathaniel Gray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).