[英]How to link with Benchmark in OCaml
我創建了一個簡單的文件
Benchmark.ml:
open Benchmark ;;
print_string "It works!"; print_newline() ;;
然后我嘗試使用我的Makefile的以下內容來構建它
# put here the names of your source files (in the right order)
SOURCES = benchmark.ml
# the name of the resulting executable
RESULT = benchmark
# generate type information (.annot files)
ANNOTATE = yes
# make target (see manual) : byte-code, debug-code, native-code, ...
all: debug-code
include OCamlMakefile
但是我得到了錯誤:
Unbound module Benchmark
我該怎么解決? 我嘗試使用INCDIRS
或PACKS
但無濟於事。
PACKS是正確的解決方案。
只是不要命名您的文件benchmark.ml
,如果您打算使用另一個模塊,該模塊已經稱為Benchmark
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.