caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Presicions on executable generation from caml: does ocamlopt -outpput-obj generates a main function ?
@ 2006-08-21 12:13 EL CHAAR Rabih   SGAM/AI/SAM
  0 siblings, 0 replies; only message in thread
From: EL CHAAR Rabih   SGAM/AI/SAM @ 2006-08-21 12:13 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 2228 bytes --]

Hello everyone,

I want to have some precisions concerning executable generation from an
ml file.

I am a bit accustomed with the ocamlc code generation.

 

The ml is compiled into a .cmo.

A C file is generated, embedding the cmo into a byte array which will be
passed to the function caml_startup

 

The main() function just calls the caml_startup() (or caml_main()).

 

 

My question is relevant to the ocamlopt generator.

When doing a -verbose, we see that there is no C file generated. The
.cmx is translated into assembly .asm, that in turn using ml.exe is
converted it into a .obj.

I don't know if in this case there is a main function which is defined
(inside the resulting .obj).

 

I am trying to build an executable which links to a library needing f2c
libs, libF77 and libI77. The first one needs to have a main function
defined.

 

When compiling with ocamlc, everything works fine, but switching to
ocamlopt yields the error message

 

libF77.lib(main.obj) : error LNK2019: unresolved external symbol _MAIN__
referenced in function _main

 

Thanks in advance for your help.

Any pointers to ocamlopt executable generation are welcome.

 

Rabih

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. 
Societe Generale Asset Management et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. 
  
Decouvrez l'offre et les services de Societe Generale 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 Societe Generale Asset Management nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. 
 
Find out more about Societe Generale Asset Management's proposal on www.sgam.com

[-- Attachment #2: Type: text/html, Size: 6652 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-21 12:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-21 12:13 Presicions on executable generation from caml: does ocamlopt -outpput-obj generates a main function ? EL CHAAR Rabih   SGAM/AI/SAM

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