Re: question about how to add a machine_func to eu ver. 3.11
- Posted by mattlewis (admin) Aug 31, 2012
- 1329 views
BRyan said...
compiling the back-end files... linking all the files... Error! E2028: foo_ is an undefined reference file be_machine.obj(C:\1000\SOURCE\be_machine.c): undefined symbol foo_
It appears that I am not decorating the function properly. How do I indicate to the compiler that the c code is calling a euphoria function in execute.e ?
Yes, this is somewhat tricky. Basically, you need to call it as a callback. I think that the easiest way to do this is probably to add another machine function that takes the address of your function as a callback. Then you can store that in a function pointer in be_machine.c, and call the callback when that machine func is invoked.
Matt