Kaleidoscope Build Error

(cc'ing llvm-dev)

Hello Gregory,

i just recompiled llvm from scratch, and was able to build the ocaml
kaleidoscope bindings. Did you know the llvm's build system already
can compile the kaleidoscope tutorials for you? You can run this to
build them:

make BUILD_EXAMPLES=1

Or just cd into the examples directory in your build directory, and
run "make" there.

Anyway, I think the problem you're probably running into is that you
need to link with the ocaml "-cc g++" argument in order to link
against the c++ libraries, as in this:

/opt/local/bin/ocamlopt -cc g++ -pp camlp4of -I
/Users/erickt/Projects/llvm/gcc/llvm-build-Release/examples/OCaml-Kaleidoscope/Chapter7/Release+Asserts
-I /Users/erickt/Projects/llvm/gcc/llvm-build-Release/Release+Asserts/lib/ocaml
llvm.cmxa llvm_analysis.cmxa llvm_executionengine.cmxa
llvm_target.cmxa llvm_scalar_opts.cmxa -o
/Users/erickt/Projects/llvm/gcc/llvm-build-Release/examples/OCaml-Kaleidoscope/Chapter7/Release+Asserts/OCaml-Kaleidoscope-Ch7
/Users/erickt/Projects/llvm/gcc/llvm-build-Release/examples/OCaml-Kaleidoscope/Chapter7/Release+Asserts/ast.cmx
/Users/erickt/Projects/llvm/gcc/llvm-build-Release/examples/OCaml-Kaleidoscope/Chapter7/Release+Asserts/parser.cmx
/Users/erickt/Projects/llvm/gcc/llvm-build-Release/examples/OCaml-Kaleidoscope/Chapter7/Release+Asserts/codegen.cmx
/Users/erickt/Projects/llvm/gcc/llvm-build-Release/examples/OCaml-Kaleidoscope/Chapter7/Release+Asserts/lexer.cmx
/Users/erickt/Projects/llvm/gcc/llvm-build-Release/examples/OCaml-Kaleidoscope/Chapter7/Release+Asserts/token.cmx
/Users/erickt/Projects/llvm/gcc/llvm-build-Release/examples/OCaml-Kaleidoscope/Chapter7/Release+Asserts/toplevel.cmx
/Users/erickt/Projects/llvm/gcc/llvm-build-Release/examples/OCaml-Kaleidoscope/Chapter7/Release+Asserts/toy.cmx

Please let me know if that doesn't work for you.