Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

embed V7 in Arduino Code

Hi.

First of all sorry for this basic question. I'm trieng to add the V7 interpreter to my arduino code to use with ESP8266.

I tried to use the the basic code, but it didn't compile. Could any one help me?


include "strings.h"

include "mjs.h"

void foo(int x) {
printf("Hello %d!\n", x);
}
//
//void *my_dlsym(void *handle, const char *name) {
// if (strcmp(name, "foo") == 0) return foo;
// return NULL;
//}
//
//

void setup() {
// put your setup code here, to run once:
struct mjs *mjs = mjs_create();
//mjs_set_ffi_resolver(mjs, my_dlsym);
mjs_exec(mjs, "let f = ffi('void foo(int)'); f(1234)", NULL);
return ;
}

void loop() {
// put your main code here, to run repeatedly:


THE compile information:

/var/folders/72/568_sxq93bl98xpn3my7p1cw0000gn/T/arduino_build_64995/libraries/mjs-master/mjs.c.o: In function

vtop':
.../Arduino/libraries/mjs-master/mjs.c:5094: undefined reference to
__ctype_ptr__'
...//Arduino/libraries/mjs-master/mjs.c:5094: undefined reference to
fwrite'
/var/folders/72/568_sxq93bl98xpn3my7p1cw0000gn/T/arduino_build_64995/libraries/mjs-master/mjs.c.o: In function
json_printer_file':

Thanks!

Comments

Sign In or Register to comment.