Thanks for reporting it!

I fixed the issue and uploaded the changes to GitHub, which should go into
the next release (ATS2-0.3.4).

By the way, patsopt_version is NOT a template. So one needs -latslib when
using it.
I forgot the need to compile patsopt_version when generating the libatsopt
library.

On Wed, Mar 8, 2017 at 7:55 PM, spearman <pearman...@gmail.com> wrote:

> Trying to call `patsopt_version` in the following simple program:
>
> #include "share/atspre_define.hats"
> #include "share/atspre_staload.hats"
>
> implement main0 () = (
>   println!(patsopt_version());
>   exit_errmsg_void (0, "foo\n")
> )
>
> generates the compiler error:
>
> /tmp/cc8XdQB8.o: In function `mainats_void_0':
> patsver_dats.c:(.text+0x181): undefined reference to `
> atspre_patsopt_version'
> collect2: error: ld returned 1 exit status
>
> and a couple warnings:
>
> patsver_dats.c: In function ‘mainats_void_0’:
> patsver_dats.c:343:1: warning: implicit declaration of function ‘
> atspre_patsopt_version’ [-Wimplicit-function-declaration]
>  ATSINSmove(tmp2, atspre_patsopt_version()) ;
>  ^
> In file included from patsver_dats.c:15:0:
> /home/spearman/ats/remote/ATS2-Postiats/ccomp/runtime/pats_ccomp_instrset.
> h:270:35: warning: assignment makes pointer from integer without a cast 
> [enabled
> by default]
>  #define ATSINSmove(tmp, val) (tmp = val)
>                                    ^
> patsver_dats.c:343:1: note: in expansion of macro ‘ATSINSmove’
>  ATSINSmove(tmp2, atspre_patsopt_version()) ;
>  ^
>
> Commenting out the line to call `patsopt_version` compiles and runs
> successfully emitting the exit message.
>
> --
> You received this message because you are subscribed to the Google Groups
> "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ats-lang-users+unsubscr...@googlegroups.com.
> To post to this group, send email to ats-lang-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/ats-lang-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ats-lang-users/b0b17fed-0eae-4113-95cf-3f93b266571c%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/ats-lang-users/b0b17fed-0eae-4113-95cf-3f93b266571c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqj8k3z48hAEqJHnuWwK%2BHy7d8LPFfCync1B_7d%3DUY-Ww%40mail.gmail.com.

Reply via email to