caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Linking camlidl stub code
@ 2002-08-16  7:14 Florian Hars
  2002-08-19 15:58 ` Florian Hars
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Hars @ 2002-08-16  7:14 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] Linking camlidl stub code
  2002-08-16  7:14 [Caml-list] Linking camlidl stub code Florian Hars
@ 2002-08-19 15:58 ` Florian Hars
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Hars @ 2002-08-19 15:58 UTC (permalink / raw)
  To: caml-list

Florian Hars wrote:
> My remainig problem is how to link my programs with the generated stub 
> code.

To answer my own questions:
Don't trust OcamlMakefile (at lest not the version from march 2001) to handle 
all the IDL stuff.

If I compile all my C stub code files (the libfoo library I want to interface 
to has several related, but technically independent subsets of its API which I 
want to put in different modules) and put them into a libfoostubs.a, I can then 
compile the Ocaml side of then stub code with
   -cclib foostubs -cclib foo -cclib camlidl
into a cm(x)a, and things work. Phew....

Yours, Florian.

-------------------
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-19 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-16  7:14 [Caml-list] Linking camlidl stub code Florian Hars
2002-08-19 15:58 ` Florian Hars

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).