caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Corey O'Connor" <coreyoconnor@gmail.com>
To: Ocaml <caml-list@inria.fr>
Subject: Problems linking in an object file produced with "ocamlopt -c -output-obj"
Date: Mon, 16 May 2005 11:31:41 -0700	[thread overview]
Message-ID: <c1291235050516113140367a1a@mail.gmail.com> (raw)

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


             reply	other threads:[~2005-05-16 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-16 18:31 Corey O'Connor [this message]
2005-05-17  6:14 ` Corey O'Connor
2005-05-17  6:52   ` [Caml-list] " skaller
2005-05-18  8:02     ` Marcin 'Qrczak' Kowalczyk

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=c1291235050516113140367a1a@mail.gmail.com \
    --to=coreyoconnor@gmail.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).