Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Mac OSX: calling OCaml from Objective-C in Xcode 2.2
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-24 (04:14)
From: Ker Lutyn <ker527mail@y...>
Subject: Mac OSX: calling OCaml from Objective-C in Xcode 2.2
I have a static library "libmylib.a" containing wrapped OCaml code using the
Callback module (the code is compiled with ocamlopt and g++, and the library
includes libasmrun.a):

$ g++ -o foo libmylib.a

This works fine. Now, when I drop libmylib.a into my Xcode 2.2 project and
build, I get the following error:

/usr/bin/ld: libmylib.a(power.o) has local relocation entries in non-writable
section (__TEXT,__text)
collect2: ld returned 1 exit status

I have Googled for this and the only answer I can find is that -mdynamic-no-pic
flag should not be sent; this flag is controlled by the "Generate
Position-Dependent Code" flag in the "Code Generation" part of the Project
Build Settings. In my case, whether this is set or not makes no difference to
the error.

Does anyone have experience with this error?

ocaml version 3.09.0
gcc 4.0.1
Mac OSX 10.4.3
Xcode 2.2

Yahoo! Mail - PC Magazine Editors' Choice 2005