-
-
Save Leonidas-from-XIV/c52d47cff10e4fe8af33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OASISFormat: 0.3 | |
Name: ostreamer | |
Version: 0.1 | |
Synopsis: Library to deal with data streams | |
Authors: Marek Kubica | |
License: PROP | |
Plugins: META (0.3), DevFiles (0.3) | |
Library "ost" | |
Path: src/ | |
Modules: Archive | |
CSources: Archive_stubs.c | |
CCLib: -larchive | |
BuildTools: ocamlbuild | |
Executable "ost-launch" | |
Path: src | |
BuildTools: ocamlbuild | |
CompiledObject: best | |
MainIs: launch.ml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
external version_number: unit -> unit = "ost_version_number" | |
let version = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <caml/mlvalues.h> | |
#include <archive.h> | |
CAMLprim value ost_version_number(value unit) | |
{ | |
printf("%d\n", archive_version_number()); | |
return Val_unit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ocaml setup.ml -build | |
findlib: [WARNING] cannot read directory /usr/lib/ocaml/site-lib: No such file or directory | |
+ ocamlfind ocamlopt -g -linkpkg src/Archive.cmx src/launch.cmx -o src/launch.native | |
src/launch.o: In function `camlLaunch__entry': | |
/home/marek/ostreamer/_build/src/launch.ml:3: undefined reference to `ost_version_number' | |
src/Archive.o: In function `camlArchive': | |
(.data+0x10): undefined reference to `ost_version_number' | |
collect2: error: ld returned 1 exit status | |
File "caml_startup", line 1: | |
Error: Error during linking | |
Command exited with code 2. | |
Compilation unsuccessful after building 13 targets (11 cached) in 00:00:00. | |
E: Failure("Command ''/usr/bin/ocamlbuild' src/libost_stubs.a src/dllost_stubs.so src/ost.cma src/ost.cmxa src/ost.a src/ost.cmxs src/launch.native -tag debug' terminated with error code 10") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ocamlbuild -classic-display src/libost_stubs.a src/dllost_stubs.so src/ost.cma src/ost.cmxa src/ost.a src/ost.cmxs src/launch.native -tag debug | |
/usr/bin/ocamlopt.opt -I /usr/lib/ocaml/ocamlbuild unix.cmxa /usr/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /usr/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild | |
findlib: [WARNING] cannot read directory /usr/lib/ocaml/site-lib: No such file or directory | |
ocamlfind ocamlc -c src/Archive_stubs.c | |
mv Archive_stubs.o src/Archive_stubs.o | |
/usr/bin/ocamlmklib -o src/ost_stubs -larchive src/Archive_stubs.o | |
ocamlfind ocamldep -modules src/Archive.ml > src/Archive.ml.depends | |
ocamlfind ocamlc -c -g -I src -o src/Archive.cmo src/Archive.ml | |
ocamlfind ocamlc -a -dllib -lost_stubs -cclib -lost_stubs -cclib -larchive src/Archive.cmo -o src/ost.cma | |
ocamlfind ocamlopt -c -g -I src -o src/Archive.cmx src/Archive.ml | |
ocamlfind ocamlopt -a -cclib -lost_stubs -cclib -larchive src/Archive.cmx -o src/ost.cmxa | |
ocamlfind ocamlopt -shared -linkall -I src/ src/ost.cmxa -o src/ost.cmxs | |
ocamlfind ocamldep -modules src/launch.ml > src/launch.ml.depends | |
ocamlfind ocamlc -c -g -I src -o src/launch.cmo src/launch.ml | |
ocamlfind ocamlopt -c -g -I src -o src/launch.cmx src/launch.ml | |
ocamlfind ocamlopt -g -linkpkg src/Archive.cmx src/launch.cmx -o src/launch.native | |
+ ocamlfind ocamlopt -g -linkpkg src/Archive.cmx src/launch.cmx -o src/launch.native | |
src/launch.o: In function `camlLaunch__entry': | |
/home/marek/ostreamer/_build/src/launch.ml:3: undefined reference to `ost_version_number' | |
src/Archive.o: In function `camlArchive': | |
(.data+0x10): undefined reference to `ost_version_number' | |
collect2: error: ld returned 1 exit status | |
File "caml_startup", line 1: | |
Error: Error during linking | |
Command exited with code 2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let _ = | |
print_endline (Printf.sprintf "ost-launch %d" Archive.version); | |
Archive.version_number () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment