这是我的Makefile
CC = ocamlc
LIBES = str.cma
CFLAGS = -g -c
.PHONY : clean
dpll:
-rm -f dpll
$(CC) $(CFLAGS) dpll.ml
$(CC) -o dpll $(LIBES) dpll.cmo
make clean
test:
./dpll input.cnf
clean:
rm -f *.cmi *.cmo
我的OCaml文件是这样的(dpll是其中的一部分)。
let dpll_SAT =
try
let cnf = read_cnf Sys.argv.(1) in
let state = create_state [] cnf in
let (result, ass) = dpll state in
match result with
|false -> print_string "the cnf clauses are not satisfiablen"
|_-> print_string "The cnf clauses are satisfiable and a model is as follows:n";
print_assignment ass;;
with
|x ->
print_endline ("Backtrace: "^(Printexc.get_backtrace ()));
raise x)
我得到以下错误:
Backtrace: (Program not linked with -g, cannot print stack backtrace)
Fatal error: exception Not_found
(Program not linked with -g, cannot print stack backtrace)
那么我该如何将其联系起来呢?
非常感谢
可能带有错误消息中建议的-g
标志。
将-g
标志添加到此行:$(CC) -o dpll $(LIBES) dpll.cmo