Regarding you questions 1) and 2) you can have a look at my answer to this question on stackoverflow: http://stackoverflow.com/questions/20851390/passing-a-string-to-a-c-library-from-ocaml-using-ctypes-and-foreign/ Best, Daniel