2 つの .ml でプロジェクトをコンパイルしようとしていますが、そのうちの 1 つはこの形式に従うモジュールです。
module Mymodule =
struct
...
end;;
myModule の .mli も作成しました
module Mymodule =
sig
...
end
しかし今、main.ml で Mymodule.myfunction を呼び出すと、"Unbound value Mymodule.myfunction"
.
これが私のmakefileです(標準のOcamlMakeFileもあります):
RESULT= result
SOURCES= Mymodule.ml main.ml
LIBS= bigarray sdl sdlloader sdlttf sdlmixer
INCDIRS= +sdl
include OCamlMakefile
私は検索していくつかのことを試しましたが、何も機能していません:(
回答ありがとうございます。リンクしたチュートリアルに従いましたが、SDL リンクに問題があります。
File "testsdl_2.ml", line 1, characters 0-1:
Error: No implementations provided for the following modules:
Sdl referenced from testsdl_2.cmx
Sdlloader referenced from testsdl_2.cmx
Sdlvideo referenced from testsdl_2.cmx
そして、私はこの行を使用してコンパイルしています:
ocamlopt -I +sdl -o testsdl mymodule.cmx main.ml