← index #17271Issue #18292
Off-topic · high · value 0.618
QUERY · ISSUE

cannot open source file "alloca.h" when trying to write a C module for MicroPython

openby marrowbusteropened 2025-05-09updated 2025-07-14
bugneeds-info

Port, board and/or hardware

rp2 port, Waveshare RP2040-PiZero

MicroPython version

MicroPython v1.25.0 on 2025-04-15; Raspberry Pi Pico with RP2040

Reproduction

Was working on a C module file for MicroPython and included this repo as a submodule but when it got time to #includeing the necessary header files, I got the above error. Apparently it's because alloca.h is only present on Linux and I'm using VSCode on Windows with the MicroPico extension. How shall I remedy this?

Expected behaviour

No response

Observed behaviour

Hovering over the #include "py/runtime.h" file leads to the error cannot open source file "alloca.h" being shown.

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