caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "HENRIKSON, JEFFREY" <JEFHEN@SAFECO.com>
To: <caml-list@inria.fr>
Subject: [Caml-list] mingw dll hell
Date: Fri, 27 Feb 2004 14:50:43 -0800	[thread overview]
Message-ID: <9410EC84C0872141B27A2726613EF45D02A52CEA@psmrdcex01.psm.pin.safeco.com> (raw)

This refers to my earlier post about dll trouble.  I am having
inconsistent dll linking behavior, though things are getting better as I
futz with more flags.  Again, three weeks ago all this same code and
build scripts worked perfectly.  One thing I seem to be noticing is that
there are fewer errors if I do not link to libraries that depend on
cygwin1.dll.

Here is one case I do not understand.  Under some builds I can ocamlrun
an exe with success, but running the exe by itself crashes.  (An
exception is probably being thrown, but I can't see it.)  Running under
GDB runs successfully.  How can this be?


Jeff Henrikson


--------------------------------

ocaml: 3.07pl2 mingw
pcre: 4.4
pcre-ocaml: 5.04.3
gcc: 3.3.1
windows: 2000

jefhen@HOXPCXJEFHEN ~/src/pcre-ocaml-5.04.3/lib
$ test

jefhen@HOXPCXJEFHEN ~/src/pcre-ocaml-5.04.3/lib
$ ocamlrun test.exe
hello
this12.3 is 2.78a t3st.
12 3 2 78 3
jefhen@HOXPCXJEFHEN ~/src/pcre-ocaml-5.04.3/lib
$ test.exe

jefhen@HOXPCXJEFHEN ~/src/pcre-ocaml-5.04.3/lib
$ gdb test.exe
GNU gdb 2003-09-20-cvs (cygwin-special)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i686-pc-cygwin"...(no debugging symbols
found)...
(gdb) run
Starting program: /cygdrive/c/src/pcre-ocaml-5.04.3/lib/test.exe
hello
this12.3 is 2.78a t3st.
12 3 2 78 3
Program exited normally.
(gdb) quit

jefhen@HOXPCXJEFHEN ~/src/pcre-ocaml-5.04.3/lib
$


test.ml:

output_string stdout "hello\n"; flush stdout;

open Printf;;
open Pcre;;

let s = "this12.3 is 2.78a t3st.";;

let r = regexp "([0-9]+)";;

let a = extract_all ~full_match:false ~rex:r s;;

printf "%s\n" s;;

Array.iter (fun e -> printf "%s " e.(0)) a;;

flush stdout;

0;;


build commands:


ocamlc -c pcre.mli -o pcre.cmi
ocamlc -c pcre.ml -o pcre.cmo
gcc -mno-cygwin -D__MINGW32__ -I c:\ocaml\lib -I/usr/include -I
/usr/include/w32api -c pcre_stubs.c
gcc -mno-cygwin -shared -L `ocamlc -where` -o dllpcre_stubs.dll
-Wl,--out-implib,libpcre_stubs.a pcre_stubs.o -L . -lpcre-mingw `ocamlc
-where`/ocamlrun.a
Creating library file: libpcre_stubs.a
Info: resolving _local_roots by linking to __imp__local_roots
(auto-import)
chmod 777 dllpcre_stubs.dll
ocamlc -a -o pcre.cma pcre.cmo -dllib -lpcre_stubs


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


             reply	other threads:[~2004-02-27 22:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27 22:50 HENRIKSON, JEFFREY [this message]
2004-02-27 23:42 ` Peter Jolly
  -- strict thread matches above, loose matches on Subject: below --
2004-02-27 23:57 HENRIKSON, JEFFREY
2004-02-22 23:04 Jeff Henrikson

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=9410EC84C0872141B27A2726613EF45D02A52CEA@psmrdcex01.psm.pin.safeco.com \
    --to=jefhen@safeco.com \
    --cc=caml-list@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).