如何解决对 dynloadflag 的未定义引用?

How to solve undefined reference to dynloadflag?

我的确切错误 link-时间错误是:

print.o: In function `_057_home_057_brandon_057_workspace_057_fsh_057_print_056_dats__dynload':
/home/brandon/workspace/fsh/print_dats.c:315: undefined reference to `_057_home_057_brandon_057_workspace_057_fsh_057_print_056_dats__dynloadflag' 

print.dats的内容就是:

typedef FormatStruct = $extype"Format"

vtypedef Format(ll: addr) = (FormatStruct @ ll | ptr ll)

extern fun fmtputc{ll: addr}(fmt: Format(ll), cc: int): void = "mac#"

我有另一个似乎不会导致此问题的 dats 文件 (main.dats)。是否有一些 ATS 库需要添加到 LDFLAGS?

ATS 中的每个 DATS 文件都被认为是某种模块,需要 初始化。如果不需要初始化,则需要添加以下内容 此 DATS 文件中的行

#define ATS_DYNLOADFLAG 0

否则,你需要像下面这样一行

#dynload“/path/to/foo.dats”

在使用此模块的主文件中。