1

mupdfライブラリのいくつかの関数のカスタムバージョンでmupdfをコンパイルしています。互いに呼び出しているように見える 2 つの関数があるため、_customそれらのバージョンを作成すると、コンパイル時にエラーが発生します。

pc@pc:~/sviluppo/mupdf-0.9$ make
CC build/debug/obj_print.o
fitz/obj_print.c: In function ‘fmt_array_custom’:
fitz/obj_print.c:191:4: warning: implicit declaration of function ‘fmt_obj_custom’
fitz/obj_print.c: At top level:
fitz/obj_print.c:304:13: warning: conflicting types for ‘fmt_obj_custom’
fitz/obj_print.c:304:13: error: static declaration of ‘fmt_obj_custom’ follows non-static declaration
fitz/obj_print.c:191:4: note: previous implicit declaration of ‘fmt_obj_custom’ was here
make: *** [build/debug/obj_print.o] Errore 1

どうしたの?関数のデフォルト バージョンは、すでに同じ方法で互いに呼び出しています。

4

1 に答える 1

1

191行目では、関数fmt_array_customは事前の宣言なしで呼び出されています。したがって、コンパイラは暗黙的に宣言(non- static)を想定します。

後の304行で、実際の関数の宣言/定義が表示されstaticます。これは対立です。

これを修正するには、行191の前に宣言を追加できます。行304から関数proto-type(本文なし)をコピーするだけです。

于 2011-09-21T10:32:36.463 に答える