noyesno / awka

Revive awka - Awk to C Compiler
https://project.noyesno.net/awka/
99 stars 9 forks source link

Support of == #17

Open pengyu opened 3 years ago

pengyu commented 3 years ago

The following code does not work. Can it be fixed?

$ cat a.awk
function f(x) {
    return x == "a"
}
{ print $0, f($0) }
$ awka -f  a.awk  > a.c
$ gcc -lawka a.c
Undefined symbols for architecture x86_64:
  "_awka_strncpy", referenced from:
      _main in a-860d69.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
jlp765 commented 2 years ago

The issue is the libawka library is not being found by the linker (or not matched to the x86_64 architecture).