caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "EL CHAAR Rabih   SGAM/AI/SAM" <RABIH.ELCHAAR@sgam.com>
To: "caml-list" <caml-list@yquem.inria.fr>
Subject: Presicions on executable generation from caml: does ocamlopt -outpput-obj generates a main function ?
Date: Mon, 21 Aug 2006 14:13:36 +0200	[thread overview]
Message-ID: <B511C5C4DC09D34D89D3508E00314ED40B9E61@FRDEF-EXMB03.europe.am.socgen> (raw)

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

                 reply	other threads:[~2006-08-21 12:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B511C5C4DC09D34D89D3508E00314ED40B9E61@FRDEF-EXMB03.europe.am.socgen \
    --to=rabih.elchaar@sgam.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).