Skip to content

Instantly share code, notes, and snippets.

Created May 2, 2017 18:15
Show Gist options
  • Save anonymous/cc2b69c9e86ff2213e03f59a1ac5494b to your computer and use it in GitHub Desktop.
Save anonymous/cc2b69c9e86ff2213e03f59a1ac5494b to your computer and use it in GitHub Desktop.
user@ubuntu:~/test$ ocamlopt -c test.c
user@ubuntu:~/test$ ocamlopt -c main.ml
user@ubuntu:~/test$ ocamlopt -cclib -lz main.cmx test.o -o binary
test.o: In function `main':
/home/user/test/test.c:5: undefined reference to `deflateInit_'
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
let _ = Printf.printf "hello\n"
#include "zlib.h"
void cstub(void){
deflateInit(NULL, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment