<Peter_Mc>
File "ocamltest1.ml", line 7, characters 0-10: Unbound module GMain
<smimou>
do you have lablgtk2 installed ?
<Peter_Mc>
I had a look, and found that I did not have an gMain.cma file anywhere. I have gMain.cmx and .ml, but no .cma.
<pango__>
liblablgtk-ocaml-dev or liblablgtk2-ocaml-dev ?
<Peter_Mc>
Yes, I do have lablgtk2 installed.
<Peter_Mc>
Yes. I have all of those. They are all brought in by ocaml-core and ocaml-libs.
<smimou>
it should be in lablgtk.cma or smth like that
<mfurr>
Peter_Mc: you need to add "-I +lablgtk2"
<Peter_Mc>
What does that do?
<mfurr>
add the directory lablgtk2 to your module search path (the + means above the system module directory)
<smimou>
and it should me lablgtk.cma not gMain.cma
<smimou>
% ocamlobjinfo lablgtk.cma|grep GMain
<smimou>
Unit name: GMain
<smimou>
e9e11e5896c0ad5c2c6931468cc86f73 GMain
<Peter_Mc>
Ah yes! Thank you. It all works! (Well, to be exact, I get a completely different set of compiler errors, but that's good enough for me.)
<smimou>
good luck for the rest
<Peter_Mc>
Why isn't this mentioned on the ocaml tutorial? It gives the code, but makes no mention of what I need to do to compile it.
<Peter_Mc>
Anyway, thank you, smimou & mfurr.
<Peter_Mc>
Is the tutorial still a work in progress?
Submarine has quit ["Leaving"]
<smimou>
yes it is
<Peter_Mc>
In that case ... maybe you could shed some light on the error messages that I'm getting.
<Peter_Mc>
The compiler's complaining about something in the first few lines of code, and I'm sure that I've correctly transcribed it from the code given on the web-page.
<smimou>
go on, we'll see
<Peter_Mc>
open StdLabels open GMain let file_dialog ~title ~callback ?filename () = let sel = GWindow.file_selection ~title ~modal:true ?filename () in sel#cancel_button#connect#clicked ~callback:sel#destroy; sel#ok_button#connect#clicked ~callback:do_ok;
<Peter_Mc>
...
<Peter_Mc>
compiler complains that:
<Peter_Mc>
File "ocamltest1.ml", line 20, characters 2-57: Warning: this expression should have type unit. File "ocamltest1.ml", line 21, characters 42-47: Unbound value do_ok
<Peter_Mc>
Do you see any obvious reason why these messages should be cropping up?
<mfurr>
well for starters, its looking for a function or value named "do_ok" and can't find it... do you have a function called that?
<Peter_Mc>
No. I assumed that do_ok was being imported from one of the libraries.
<Peter_Mc>
Oh... hang on.
<Peter_Mc>
I've just done something really dumb.
<Peter_Mc>
lol
<Peter_Mc>
"In this section we're going to show some real code fragments from the lablgtk 1.2 library...."
<Peter_Mc>
It's just some exhibited code fragments.
* Peter_Mc
*blushes*
<Peter_Mc>
It was never meant to be compiled and run.
<smimou>
heh
ramen has joined #ocaml
Smerdyakov has joined #ocaml
<Peter_Mc>
So much for "RTFM". Anyway, thanks for your help.
<Peter_Mc>
I'll come back later when I've more stupid questions to ask.
Peter_Mc has quit ["Started wasting time elsewhere"]