这是我的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 satisfiable\n"
|_-> 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)那么我该如何链接它呢?
非常感谢
发布于 2013-08-01 20:04:33
可能使用错误消息所建议的-g标志。
将-g标志添加到此行:$(CC) -o dpll $(LIBES) dpll.cmo
https://stackoverflow.com/questions/17992944
复制相似问题