<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/10/c1af550ea8aa0a1e792263146a015857"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-10-15T09:36:16"
  subject="[Caml-list] &quot;Error while building custom runtime system&quot;"
  prev="2003/10/aa7c2c5e40101b01565455bcd17f0456"
  next="2003/10/57c7a1c5ff0f45f78d981bdff9210697"
  next-in-thread="2003/10/e8b532a1e5370741fb38319486356a7f"
  prev-thread="2003/10/3df891effe980ef58591b1b70f0a4bc3"
  next-thread="2003/10/3514d436ed9f160807888aa6f0870822"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] &quot;Error while building custom runtime system&quot;">
<msg 
  url="2003/10/c1af550ea8aa0a1e792263146a015857"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-10-15T09:36:16"
  subject="[Caml-list] &quot;Error while building custom runtime system&quot;">
<msg 
  url="2003/10/e8b532a1e5370741fb38319486356a7f"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-10-15T16:57:25"
  subject="[Caml-list] Initialization order bug">
<msg 
  url="2003/10/c31697388e2560e2b0cff458c809794a"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-10-16T09:18:40"
  subject="Re: [Caml-list] Initialization order bug">
</msg>
</msg>
</msg>
</thread>

<contents>
I'm getting very strange behaviour from ocamlc when linking. Here's my
small test program. Note the '-verbose' arg:

$ ocamlc -verbose -I +perl -w s perl4caml.cma perl_init.cmo loadpage.cmo -o loadpage
$

(ie. everything is OK - it doesn't run any external programs such as gcc
or ld).

Now here's the *real* program I want to compile, note also the -verbose
arg:

$ ocamlc -verbose -w s -I +lablgtk2 -I ../lablgtk2-mozembed -I +apache -I +postgres -I +perl -I +pcre unix.cma pcre.cma lablgtk.cma gtkInit.cmo lablgtkmoz.cma postgres.cma dbi.cmo dbi_postgres.cmo perl4caml.cma perl_init.cmo lib.cmo globals.cmo database.cmo google.cmo loadpage.cmo parsepage.cmo gtkError.cmo gtkTied.cmo selection_dialog.cmo browser.cmo mainWindowControls.cmo autoPage.cmo productRankingPage.cmo salesAsmtPage.cmo commitPage.cmo pages.cmo main.cmo -o assessor
+ gcc -Wl,-E -o 'assessor' -I'/usr/lib/ocaml/3.07' -L/usr/local/lib -L/usr/lib/perl/5.8.1/CORE -Wl,-rpath,/usr/local/lib:/usr/lib/perl/5.8.1/CORE -L/usr/lib/mozilla -Wl,-rpath,/usr/lib/mozilla /tmp/camlprim5ffb86.c  '-L/usr/lib/ocaml/3.07/lablgtk2' '-L../lablgtk2-mozembed' '-L/usr/lib/ocaml/3.07/apache' '-L/usr/lib/ocaml/3.07/postgres' '-L/usr/lib/ocaml/3.07/perl' '-L/usr/lib/ocaml/3.07/pcre' '-L/usr/lib/ocaml/3.07' '-lperl4caml' '-lperl' '-ldl' '-lm' '-lpthread' '-lc' '-lcrypt' '-lpq' '-lmlpostgres' '-llablgtkmoz' '-lgtkembedmoz' '-lxpcom' '-lplds4' '-lplc4' '-lnspr4' '-ldl' '-lc' '-lpthread' '-llablgtk2' '-lgtk-x11-2.0' '-lgdk-x11-2.0' '-latk-1.0' '-lgdk_pixbuf-2.0' '-lm' '-lpangoxft-1.0' '-lpangox-1.0' '-lpango-1.0' '-lgobject-2.0' '-lgmodule-2.0' '-ldl' '-lglib-2.0' '-lpcre_stubs' '-lpcre' '-lunix' -lcamlrun -lm  -ldl -lcurses -lpthread
/usr/lib/ocaml/3.07/perl/libperl4caml.a(perl_c.o)(.text+0x1b): In function `xs_init':
: undefined reference to `boot_DynaLoader'
collect2: ld returned 1 exit status
Error while building custom runtime system

I'm not using the -custom option anywhere. Ocamlc seems to react
entirely differently. First it launches gcc. Secondly (and more
importantly) it fails to link in a particular static library which I
specified when I created perl4caml.cma.

The test program also relies on the 'boot_DynaLoader' symbol, so I
don't understand why the test program works, but the real program
fails, and why ocamlc works completely differently in each case.
Something to do with the other libraries I'm using??

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you.
"I wish more software used text based configuration files!"
 -- A Windows NT user, quoted on Slashdot.

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

</contents>

</message>

