emscripten-core / emscripten-core/emscripten

why web assembly can invoke c library function??

Open
#15,253 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 6h
Merged PRs (30d)
109

Description

i have read the tutorial in official documentation, but cannot figure it out why ws supports c library like glibc stdlibc etc. From the doc I know that
1. C code can be converted to a wasm file which runs in a browser.
2. the wasm 's content is some cross-platform intermediate code.
now I have a main.c file like below
#include
int main () {
...
printf("helloworld");
..
}
my question is why printf works?? as I understand the c library binary code which including printf.o is not in my wasm file.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.