Page 1 of 1

[SOLVED] Need advice with 'execfile'

Posted: Fri Apr 20, 2018 11:09 am
by chrizztus
Hi,
on activating execfile option by enabling:

Code: Select all

#define MICROPY_PY_BUILTINS_EXECFILE (1)
I'm getting the following compile error:

Code: Select all

CC micropython/py/modbuiltins.c
In file included from ./micropython/py/objint.h:30:0,
                 from micropython/py/modbuiltins.c:31:
micropython/py/modbuiltins.c:657:19: error: 'MP_QSTR_execfile' undeclared here (not in a function); did you mean 'MP_QSTR_exec'?
     { MP_ROM_QSTR(MP_QSTR_execfile), MP_ROM_PTR(&mp_builtin_execfile_obj) },
                   ^
./micropython/py/obj.h:92:56: note: in definition of macro 'MP_OBJ_NEW_QSTR'
 #define MP_OBJ_NEW_QSTR(qst) ((mp_obj_t)((((mp_uint_t)(qst)) << 2) | 2))
                                                        ^~~
micropython/py/modbuiltins.c:657:7: note: in expansion of macro 'MP_ROM_QSTR'
     { MP_ROM_QSTR(MP_QSTR_execfile), MP_ROM_PTR(&mp_builtin_execfile_obj) },
       ^~~~~~~~~~~
make: *** [micropython/py/mkrules.mk:47: build/py/modbuiltins.o] Error 1
How can I get rid of this error? Do I miss something?
Regards
Christian

Re: Need advice with 'execfile'

Posted: Fri Apr 20, 2018 12:58 pm
by stijn
This is a known issue: you need a full rebuild to generate the qstrs again. Some technical discussion here: https://github.com/micropython/micropython/issues/2982

[SOLVED] Need advice with 'execfile'

Posted: Fri Apr 20, 2018 1:55 pm
by chrizztus
Ok, I found out by myself. Obviously it makes a difference whether the project was cleaned before enabling builtin modules. Otherwise it might lead into compile errors.
Greetings
Christian

Re: [SOLVED] Need advice with 'execfile'

Posted: Mon May 07, 2018 6:27 pm
by jickster
chrizztus wrote:
Fri Apr 20, 2018 1:55 pm
Ok, I found out by myself. Obviously it makes a difference whether the project was cleaned before enabling builtin modules. Otherwise it might lead into compile errors.
Greetings
Christian
I noticed you marked the post I'm replying to as [SOLVED] but in order for it to show up in forum, you have to edit the title of your first post.