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
[Caml-list] Linking camlidl stub code
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-16 (07:14)
From: Florian Hars <florian@h...>
Subject: [Caml-list] Linking camlidl stub code
After fighting with the system for some time (I think I learned the hard way 
why the next version of camlidl uses foo_stub.c instead of foo.c :-)) I have an 
IDL file for the C-library I want to use that sort of works (I still have to 
edit  the generates foo.h since I do some enum <-> int and struct mangling that 
requires a header file, but leads to errors with the standard one).

My remainig problem is how to link my programs with the generated stub code.
Right now I have to use "-cclib -lcamlidl" on every program that uses the 
library, which is inconvenient, and, even worse, I have to compile every 
program in the same directory as the stub code, otherwise gcc complains that it 
can't find foo_stub.o. This makes the directory "structure" for the projects 
that use the library a little bit messy.

How do I turn the stub code not only into a library, but into a *usable* library?

The generated cmxa contains things like

   @ *foo_stub.o %-lfoo )-lcamlidl@ 0-L/usr/lib/ocaml

so at least the -lcamlidl part should work without additional incantations, no?

(This is ocaml 3.04/camlidl 1.02, apt-get says that these are the latest 
versions :-))

Yours, Florian Hars.

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners