# emcc-example
**Repository Path**: mirrors_shlomif/emcc-example
## Basic Information
- **Project Name**: emcc-example
- **Description**: Showing how to compile c++ project into javascript library using emscripten
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-12-25
- **Last Updated**: 2026-03-01
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# emcc-example
Showing how to compile c++ project into javascript library using emscripten.
### Features
* Export a function mysqrt
* Pass float argument to/from a function mysqrt
* Pass array argument to/from a function mysqrtArray
* Construct/destruct a class MyClass and call its member function
* Wrap the compiled asmjs code for easy access using pre.js & post.js
* Build the project using ./build.sh
### Build
Enter the main directory and run ./build.sh (works only in UNIX-like system)
### Repository overview
* src & include directory: the C++ project
* wrap directory: a javascript wrapper which will provide more friendly access to the built library, following [umd pattern](https://github.com/umdjs/umd)
* dist directory: the built javascript library will be here
* test directory: html testing files that call the built javascript library
* build.sh: a shell script that reads C++ project and javascript wrapper, then build the javascript library