From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 81CDD7ED9B for ; Fri, 9 May 2014 22:20:47 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of adrien@notk.org) identity=pra; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of adrien@notk.org designates 91.121.71.147 as permitted sender) identity=mailfrom; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@nautica.notk.org) identity=helo; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="postmaster@nautica.notk.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhIFAMA3bVNbeUeT/2dsb2JhbABZgwZPgz/CbQGBGhZ0giUBAQUjVhALDgoCAgUTDgICDwUYMYhYrGCkQxeBKo0oB4J1NoEVBJlGAZMCgzg7 X-IPAS-Result: AhIFAMA3bVNbeUeT/2dsb2JhbABZgwZPgz/CbQGBGhZ0giUBAQUjVhALDgoCAgUTDgICDwUYMYhYrGCkQxeBKo0oB4J1NoEVBJlGAZMCgzg7 X-IronPort-AV: E=Sophos;i="4.97,1020,1389740400"; d="scan'208";a="72908055" Received: from nautica.notk.org ([91.121.71.147]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 09 May 2014 22:20:47 +0200 Received: by nautica.notk.org (Postfix, from userid 1003) id 38F2BC009; Fri, 9 May 2014 22:20:46 +0200 (CEST) Date: Fri, 9 May 2014 22:20:46 +0200 From: Adrien Nader To: Leonardo Laguna Cc: caml-list@inria.fr Message-ID: <20140509202046.GA17828@notk.org> References: <20140509121324.GA26367@notk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] Embedding Ocaml in a windows application On Fri, May 09, 2014, Leonardo Laguna wrote: > I have given up on compiling the msvc port. I don't know why I'm getting > errors when the '.exe' is not there. > > I will try to explain better what I want to do. > > I have the following files: > > - plug.lib (provided by the software vendor, closed source, compiled with > VC++), in OSX I have plug.a > - my_main.c (the code for the plugin) > - ocaml_stub.c (this code calls 'caml_startup()') > - ocaml_code.ml > > in OSX I compile my_main.c, ocaml_stub.c and ocaml_code.ml to obtain '.o' > files. Then I link the .o files with plug.a and libasmrun.a. This works > fine. > > In windows I have wodi32, visual studio 2008 and Flexdll. I tried the > following. > - Using cl compile, ocaml_stub.c, my_main.c to obtain '.obj' files > - Using ocamlopt, compile ocaml_code.ml to obtain a '.o' file > - Using flexlink to link the .obj, .o, libasmrun.a, plug.lib, libgcc.a and > libc.a > > This gives me an error: > > ** Cannot resolve symbols for libasmrun.a(floats.o): > ___strtod > > I have tried to create my own strtod function and link it does not pick it. > > Anybody knows how can I link my program. Can you provide the commands? In particular the flexlink one? Also you probably shouldn't call flexlink directly; using ocamlc should do it. -- Adrien Nader