undefined reference to `atsruntime_malloc_undef`

62 views
Skip to first unread message

CC (corrodedCrustacean)

unread,
Jul 28, 2024, 10:18:58 AM7/28/24
to ats-lang-users
Hello,
I've recently discovered ATS and I'm following the introduction guide. I'm having trouble compiling with patscc (myatscc works, but only for a single source file) when a boxed value or a closure is defined.

Example:

#include "share/atspre_staload.hats"
val _ = '(0)
implement main0 () = print "hello"

When I compile with patscc I get the following error:

main_dats.c:(.text+0x10b): undefined reference to `atsruntime_malloc_undef'

I've installed ats2 with nix; according to patsopt I'm using version 0.4.2

gmhwxi

unread,
Jul 28, 2024, 1:09:14 PM7/28/24
to ats-lang-users

-DATS_MEMALLOC_LIBC

You need the above flag when using patscc. It is the default for myatscc.
Reply all
Reply to author
Forward
0 new messages