To get started with Cheerp, you’ll first need to install it. Or, you can try Cheerp without installing it with Cheerp playground.
Cheerp in itself has no dependencies, but the recommended workflow and the tutorials make use of:
- an HTTP server (such as http-server)
- a web browser
If you don’t have these, see recommended workflow.
Compiling your first application
You are now ready for compiling your first Web application using Cheerp.
Move to a folder of your choice and save the following C++ program as
You can then compile this program using the following command line:
You can also save this HTML file as
and from the same folder
firefox hello.html (or equivalent).
This is what the result should look like: hello.html
webMain() instead of
It would have compiled also with
int main() (try it yourself), but we wanted to show first what zero-overhead access to the browser looks like.