diff options
author | Olly Betts <olly@survex.com> | 2022-02-01 11:46:39 +1300 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2022-02-01 11:46:39 +1300 |
commit | 9c16ce8ab31cb8fe1a52063cdeb19888ba9775fa (patch) | |
tree | 296f767e00dd66e5a0eef609bd8926807a17a9ca | |
parent | 781379351167f11873bf15feb78ed500795aecda (diff) | |
download | swig-9c16ce8ab31cb8fe1a52063cdeb19888ba9775fa.tar.gz |
[ocaml] Improve the Qt example
Drop a method which has been deprecated then removed in Qt (but isn't
actually used in the example anyway) and clean up the steps a bit.
The example still doesn't build for me as the final step fails with:
File "_none_", line 1:
Error: Module `Dynlink' is unavailable (required by `Camlp4')
I know next to nothing about ocaml, so that may be something I've
failed to install, but I couldn't work out what. I think the Qt
library linking needs updating too - there doesn't seem to be a
single `-lqt` now, but I don't use Qt either.
-rw-r--r-- | Doc/Manual/Ocaml.html | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Doc/Manual/Ocaml.html b/Doc/Manual/Ocaml.html index 4ae07e969..9b59eec61 100644 --- a/Doc/Manual/Ocaml.html +++ b/Doc/Manual/Ocaml.html @@ -720,7 +720,6 @@ Here's a simple example using Trolltech's Qt Library: class QApplication { public: QApplication( int argc, char **argv ); - void setMainWidget( QWidget *widget ); void exec(); }; @@ -736,16 +735,15 @@ public: <div class="code"><pre> -bash-2.05a$ QTPATH=/your/qt/path -bash-2.05a$ for file in swig.mli swig.ml swigp4.ml ; do swig -ocaml -co $file ; done -bash-2.05a$ ocamlc -c swig.mli ; ocamlc -c swig.ml -bash-2.05a$ ocamlc -I `camlp4 -where` -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml -bash-2.05a$ swig -ocaml -c++ -I$QTPATH/include qt.i -bash-2.05a$ mv qt_wrap.cxx qt_wrap.c -bash-2.05a$ ocamlc -c -ccopt -xc++ -ccopt -g -g -ccopt -I$QTPATH/include qt_wrap.c -bash-2.05a$ ocamlc -c qt.mli -bash-2.05a$ ocamlc -c qt.ml -bash-2.05a$ ocamlmktop -custom swig.cmo -I `camlp4 -where` \ +$ QTPATH=/your/qt/path +$ for file in swig.mli swig.ml swigp4.ml ; do swig -ocaml -co $file ; done +$ ocamlc -c swig.mli ; ocamlc -c swig.ml +$ ocamlc -I `camlp4 -where` -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml +$ swig -ocaml -c++ -o qt_wrap.c qt.i +$ ocamlc -c -ccopt -xc++ -ccopt -g -g -ccopt -I$QTPATH/include qt_wrap.c +$ ocamlc -c qt.mli +$ ocamlc -c qt.ml +$ ocamlmktop -custom swig.cmo -I `camlp4 -where` \ camlp4o.cma swigp4.cmo qt_wrap.o qt.cmo -o qt_top -cclib \ -L$QTPATH/lib -cclib -lqt </pre></div> |