English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
non trivial (at least not to me) Hybrid program compiling
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-11 (18:22)
From: Manuel Preliteiro <hankalagon@g...>
Subject: non trivial (at least not to me) Hybrid program compiling
Hello, i'm trying to make a OCaml binding to C library PCSCLite, and i'm not
being able to compile it, because for instance, when i try to compile the
pcsc_demo.c provided by MUSCLE i do the folowing steps:

cc `pkg-config libpcsclite --cflags` -c pcsc_demo.c
cc `pkg-config libpcsclite --libs` -o pcsc_demo pcsc_demo.o

then when i try to compile my own program i can make the 1st step as above,
only ading the OCaml lib path:

cc `pkg-config libpcsclite --cflags` -I/usr/lib/ocaml -c testC.c

but the problem comes when i have use the OCaml compiler to link to my OCaml
and C parts, i tried (with variations):

ocamlopt `pkg-config libpcsclite --libs` -o test testC.o testML.ml

but i get an option usage error...

The error is preaty explicit so i'm not obeying the compiling rules, but i'm
not geting how i'm gonna add the `pkg-config libpcsclite --libs` part,
because if i dont the C API wont be recognized by the OCaml linker...

Thank You