← index #15654Issue #18292
Related · high · value 3.801
QUERY · ISSUE

Build embed with C modules isn't working

openby volodymyr-zvarun-globallogicopened 2024-08-13updated 2025-03-03
enhancementport-embed

Port, board and/or hardware

embed

MicroPython version

MicroPython v1.22.2 on 2024-08-13; linux [GCC 4.2.1] version

Reproduction

  1. Modify examples/embedding/main.c by adding import cexample into second example
  2. From examples/embedding run
make -f micropython_embed.mk USER_C_MODULES=<micropython_path>/examples/usercmodule
make
  1. Run embed binary

Expected behaviour

Expected to start without errors

Observed behaviour

Traceback (most recent call last):
  File "<stdin>", in <module>
ImportError: module not found

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

Can't build with USER_C_MODULES on mimxrt

closedby sfe-SparkFroopened 2025-10-17updated 2026-01-31
bug

Port, board and/or hardware

mimxrt port

MicroPython version

Latest (9999553)

Reproduction

cd micropython/ports/mimxrt
make USER_C_MODULES=../../examples/usercmodule

Expected behaviour

Should compile the example user C modules without errors.

Observed behaviour

Build error:

In file included from ../../examples/usercmodule/cppexample/example.cpp:2:
../../examples/usercmodule/cppexample/examplemodule.h:2:10: fatal error: py/runtime.h: No such file or directory
    2 | #include "py/runtime.h"
      |          ^~~~~~~~~~~~~~

Additional Information

Both ports rp2 and unix work just fine, but not mimxrt. Tested with a fresh clone of MicroPython on 2 different machines.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied