Version française
Home     About     Download     Resources     Contact us    
Browse thread
ocamlopt and linking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Taras <taras.judge@s...>
Subject: ocamlopt and linking
Hi,
I'm trying to link an ocamlopt-generated object file into a C program by 
following instructions on http://caml.inria.fr/ocaml/htmlman/manual032.html

Here is a small testcase: http://glek.net/~taras/os.tar.bz2

Currently it seems that main is already defined in libasmrun and some 
symbols are missing from it.

cc -L /usr/lib/ocaml -lasmrun -ldl -lm -lcurses -o prog modwrap.o 
mod_from_ml.o main.c
/home/taras/tmp/ccWVigi0.o(.text+0x0): In function `main':
: multiple definition of `main'
/usr/lib/ocaml/libasmrun.a(main.o)(.text+0x0): first defined here
/usr/bin/ld: Warning: size of symbol `main' changed from 39 in 
/usr/lib/ocaml/libasmrun.a(main.o) to 96 in /home/taras/tmp/ccWVigi0.o
mod_from_ml.o(.text+0x584): In function `caml_curry6_5':
: undefined reference to `caml_extra_params'
mod_from_ml.o(.text+0x772): In function `caml_curry7_6':
: undefined reference to `caml_extra_params'
mod_from_ml.o(.text+0x77c): In function `caml_curry7_6':
: undefined reference to `caml_extra_params'
mod_from_ml.o(.text+0xd5e): In function `camlPervasives__min_49':
: undefined reference to `caml_lessequal'
mod_from_ml.o(.text+0xd9e): In function `camlPervasives__max_52':
: undefined reference to `caml_greaterequal'
mod_from_ml.o(.text+0x3144): In function `camlList__mem_185':
: undefined reference to `caml_compare'
mod_from_ml.o(.text+0x31da): In function `camlList__assoc_193':
: undefined reference to `caml_compare'
mod_from_ml.o(.text+0x32d6): In function `camlList__mem_assoc_203':
: undefined reference to `caml_compare'
mod_from_ml.o(.text+0x336d): In function `camlList__remove_assoc_213':
: undefined reference to `caml_compare'
mod_from_ml.o(.text+0x4893): In function `camlString__compare_176':
: undefined reference to `caml_compare'
mod_from_ml.o(.text+0x6a28): In function `camlPrintf__doprn_187':
: undefined reference to `caml_extra_params'
mod_from_ml.o(.text+0x6c08): In function `camlPrintf__doprn_224':
: undefined reference to `caml_extra_params'
mod_from_ml.o(.text+0x6d88): In function `camlPrintf__doprn_253':
: undefined reference to `caml_extra_params'
mod_from_ml.o(.text+0x72b3): In function `camlPrintf__scan_format_142':
: undefined reference to `caml_extra_params'
collect2: ld returned 1 exit status


Thanks,
Taras