Version française
Home     About     Download     Resources     Contact us    
Browse thread
Problems linking in an object file produced with "ocamlopt -c -output-obj"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Corey O'Connor <coreyoconnor@g...>
Subject: Problems linking in an object file produced with "ocamlopt -c -output-obj"
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