caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Keyan <ml@pulsschlag.net>
To: caml-list@inria.fr
Subject: [Caml-list] Creating a dynamic Library on Mac OS X
Date: Thu, 12 Jul 2012 17:09:28 +0200	[thread overview]
Message-ID: <3100B6AB-7793-4CFF-B927-1FB3A1B3E457@pulsschlag.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1554 bytes --]

Hi,

I have the following problem. In my main program, I load dynamic libraries during runtime on demand. One of those libraries will access ocaml code. Compiling works fine, until I link everything to a dynamic library, in which case I get the following error:

Undefined symbols for architecture x86_64:
  "_caml_code_area_start", referenced from:
      _segv_handler in output.a(signals_asm.o)
      _caml_code_checksum in output.a(intern.o)
      _intern_rec in output.a(intern.o)
      _extern_rec in output.a(extern.o)
  "_caml_code_area_end", referenced from:
      _segv_handler in output.a(signals_asm.o)
      _caml_code_checksum in output.a(intern.o)
      _intern_rec in output.a(intern.o)
      _extern_rec in output.a(extern.o)
  "_caml_atom_table", referenced from:
      _caml_alloc in output.a(alloc.o)
      _caml_alloc_dummy_float in output.a(alloc.o)
      _caml_alloc_dummy in output.a(alloc.o)
      _caml_alloc_array in output.a(alloc.o)
      _caml_copy_string_array in output.a(alloc.o)
      _intern_alloc in output.a(intern.o)
      _intern_rec in output.a(intern.o)
      ...
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [all] Error 1


I use:

ocaml 3.12.1
Darwin 11.4.0 (Mac OS X 10.7.4)
gcc: i686-apple-darwin11-llvm-gcc-4.2

I don't use Xcode, but cmake/make.

Attached to this email is a minimal example, demonstrating the problem. It is fully self-containable, i.e. it contains the Makefile and the source files.

Cheers,
Keyan


[-- Attachment #2: example.tar.bz2 --]
[-- Type: application/x-bzip2, Size: 1836 bytes --]

                 reply	other threads:[~2012-07-12 15:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3100B6AB-7793-4CFF-B927-1FB3A1B3E457@pulsschlag.net \
    --to=ml@pulsschlag.net \
    --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).