<?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="2005/05/2f636794b2f8de3ed225621330e47449"
  from="Corey O&apos;Connor &lt;coreyoconnor@g...&gt;"
  author="Corey O&apos;Connor"
  date="2005-05-16T18:31:43"
  subject="Problems linking in an object file produced with &quot;ocamlopt -c -output-obj&quot;"
  prev="2005/05/deccedf51511e46153d76a6b1cdb93a7"
  next="2005/05/adf977f4e0fd617a155e83f14a26ab72"
  next-in-thread="2005/05/e3905eefb5bca0ae534f009bbd2727b0"
  prev-thread="2005/05/2332def498bd48c8285be502f031bd55"
  next-thread="2005/05/fb149c55b4bdd275dae03fa8bb05efd4"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Problems linking in an object file produced with &quot;ocamlopt -c -output-obj&quot;">
<msg 
  url="2005/05/2f636794b2f8de3ed225621330e47449"
  from="Corey O&apos;Connor &lt;coreyoconnor@g...&gt;"
  author="Corey O&apos;Connor"
  date="2005-05-16T18:31:43"
  subject="Problems linking in an object file produced with &quot;ocamlopt -c -output-obj&quot;">
<msg 
  url="2005/05/e3905eefb5bca0ae534f009bbd2727b0"
  from="Corey O&apos;Connor &lt;coreyoconnor@g...&gt;"
  author="Corey O&apos;Connor"
  date="2005-05-17T06:14:26"
  subject="Re: Problems linking in an object file produced with &quot;ocamlopt -c -output-obj&quot;">
<msg 
  url="2005/05/d59623d3755a0d44964cb71dace1dc3b"
  from="skaller &lt;skaller@u...&gt;"
  author="skaller"
  date="2005-05-17T06:52:37"
  subject="Re: [Caml-list] Re: Problems linking in an object file produced with &quot;ocamlopt -c -output-obj&quot;">
<msg 
  url="2005/05/98050f94f904b8d69aaf978125ce24d7"
  from="Marcin &apos;Qrczak&apos; Kowalczyk &lt;qrczak@k...&gt;"
  author="Marcin &apos;Qrczak&apos; Kowalczyk"
  date="2005-05-18T08:03:09"
  subject="Re: [Caml-list] Re: Problems linking in an object file produced with &quot;ocamlopt -c -output-obj&quot;">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
For some reason I'm trying to integrate O'Caml into XCode nicely. Add
.ml[i] files to an XCode project and they'll get compiled and linked
into a regular, native XCode target just like any other source file.

Anyways...

Since I can't make XCode use the O'Caml compiler as the linker, I am
compiling all O'Caml files into a single object that then gets passed
to the standard linker. I believe using "ocamlopt -c the_object.o
-output-obj [my compiled ocaml files...]" then passing the_object.o,
and the required O'Caml libs to the linker is the right idea.

However, the linker is still complaining about some unresolved
symbols. I've tried various combinations of libraries and link orders
but I can't figure out where these symbols are:
_caml_atom_table
_caml_static_data_end
_caml_static_data_start
_caml_code_area_end
_caml_code_area_start

Here is the relevant section of the build log:

Link command: /usr/local/bin/ocamlopt -o sources_ml.o -output-obj
unix.cmxa OpenGL.cmx Test.cmx

Ld "/Users/coconnor/Cocoa Caml Test/build/Cocoa Caml
Test.app/Contents/MacOS/Cocoa Caml Test" normal ppc
    cd "/Users/coconnor/Cocoa Caml Test"
    setenv MACOSX_DEPLOYMENT_TARGET 10.3
    /usr/bin/gcc-4.0 -o "/Users/coconnor/Cocoa Caml Test/build/Cocoa
Caml Test.app/Contents/MacOS/Cocoa Caml Test" "-L/Users/coconnor/Cocoa
Caml Test/build" -L/usr/local/lib/ocaml "-F/Users/coconnor/Cocoa Caml
Test/build" -filelist "/Users/coconnor/Cocoa Caml Test/build/Cocoa
Caml Test.build/Cocoa Caml Test.build/Objects-normal/ppc/Cocoa Caml
Test.LinkFileList" -framework Cocoa -lcamlidl -lunix -lasmrun
-framework OpenGL -lbigarray -lthreads -lnums -lstr -lcamlrun
-lthreadsnat -arch ppc
/usr/bin/ld: Undefined symbols:
_caml_atom_table
_caml_static_data_end
_caml_static_data_start
_caml_code_area_end
_caml_code_area_start


Any ideas?

-- 
-Corey O'Connor

</contents>

</message>

