caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Problems linking in an object file produced with "ocamlopt -c -output-obj"
@ 2005-05-16 18:31 Corey O'Connor
  2005-05-17  6:14 ` Corey O'Connor
  0 siblings, 1 reply; 4+ messages in thread
From: Corey O'Connor @ 2005-05-16 18:31 UTC (permalink / raw)
  To: Ocaml

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-05-18  8:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-16 18:31 Problems linking in an object file produced with "ocamlopt -c -output-obj" Corey O'Connor
2005-05-17  6:14 ` Corey O'Connor
2005-05-17  6:52   ` [Caml-list] " skaller
2005-05-18  8:02     ` Marcin 'Qrczak' Kowalczyk

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