Kakadu / lablqml

Interfacing Qt/QML with OCaml. Formely known as lablqt
http://kakadu.github.io/lablqml
GNU Lesser General Public License v2.1
159 stars 17 forks source link

cannot compile moc #13

Closed martindemello closed 12 years ago

martindemello commented 12 years ago

I cannot get moc compiling. It fails with yaml.cma not found (see below), and when I checked the ocaml-syck package the makefile only produces the native yaml.cmxa target.

martin@mercury (master) ~/code/lablqt/moc
$ make
ocamlbuild -j 0 -use-ocamlfind mocml.byte
+ ocamlfind ocamlc -c -thread -package ocaml-syck -package core -package str -o mocml.cmo mocml.ml
File "mocml.ml", line 31, characters 8-12:
Warning 26: unused variable clas.
+ ocamlfind ocamlc -linkpkg -thread -package ocaml-syck -package core -package str helpers.cmo parse.cmo qtgui.cmo qml.cmo mocml.cmo -o mocml.byte
File "_none_", line 1:
Error: Cannot find file /home/martin/.opam/system/lib/ocaml-syck/yaml.cma
Command exited with code 2.
Compilation unsuccessful after building 11 targets (0 cached) in 00:00:03.
make: *** [build] Error 10
Kakadu commented 12 years ago

On my machine I have such files

$ ls `ocamlfind query ocaml-syck`
libyaml.a  yaml.a    yaml.cmxa     yamlNode.mli    yamlParser.mli
META       yaml.cma  yamlNode.cmi  yamlParser.cmi

AFAIR I've installed ocaml-syck by hands without any package manager. Hence, ocaml-syck in opam can be not very correct.

Maybe syck developers have forgot to install some files. In this case you should either fix install script for ocaml-syck or you can try to build native-code mocml ( I hope ocamlbuild -j 0 -use-ocamlfind mocml.byte will work)

Kakadu commented 12 years ago

@martindemello, btw, I have reached some conceptual problems with QtGUI bindings and now I thought that I don't need to create binding to whole QtGUI API. Better is to write some kind of tool which will help people to connect QML GUI with OCaml business logic.

What do u think about it? Why are you looking in lablqt?

martindemello commented 12 years ago

I compiled ocaml-syck manually and got everything compiling. I've just got back into Qt programming and find it is more pleasant than Gtk to use, so I was hoping to find some OCaml bindings. Connecting QML with an OCaml backend would be a nice way to go too; I'm not sure I have the skills to do it myself, but if you do such a project I'd definitely be interested.

Kakadu commented 12 years ago

@martindemello Hey, I'm fixing moc now to make it somehow useful. latest code is here: https://github.com/Kakadu/lablqt/tree/moc/moc Also I'm going to write a la ocamlbrowser in QML which will use this moc. Latest code: https://github.com/Kakadu/QOcamlBrowser/tree/mocml It uses mocml to generate Asdf class from input_yaml.cpp. It is compilable now but it is not very useful relatively to variant in master branch. I have an issue about emitting signals from OCaml: I've not written/generated code for it. I hope I will do it soon

P.S. Yeah, I know that OCaml code was a kind of copy-and pasted from C++ so it is terrible. But I think you already can make observation how apps with mocml will look like. Maybe You will be able to give some hints about design.