Override function fails
- Posted by irv Oct 19, 2020
- 728 views
Try the code below, please.
Run it with eui, then compile and run. Both work fine for me.
Next, uncomment the first part, and try again.
With eui, it works for me, displaying TAB 9 when tab key is pressed. It also works when bound or shrouded.
It won't compile, however.
--override function get_key() --integer x = eu:get_key() --if x = 9 then puts(1,"TAB ") end if --return x --end function integer key = 0 while 1 do key = get_key() if key = 27 then exit elsif key > 0 then printf(1,"%d %s\n",{key,key}) end if end while
$ euc -build-dir build -extra-lflags="-no-pie" -makefile getkey.ex Segmentation fault (core dumped)
Two files are created in the build folder: main-.h and init-.c - both containing a total of 0 bytes!