{"id":20622469,"url":"https://github.com/codewithmirza/sample3","last_synced_at":"2026-04-20T15:03:31.798Z","repository":{"id":254061889,"uuid":"777778392","full_name":"codewithmirza/sample3","owner":"codewithmirza","description":"compiling C++ to wasm using Emscripten","archived":false,"fork":false,"pushed_at":"2024-03-26T14:37:44.000Z","size":134,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T23:26:31.595Z","etag":null,"topics":["emscripten","webassembly","windows"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codewithmirza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-26T13:44:24.000Z","updated_at":"2024-08-21T04:57:48.000Z","dependencies_parsed_at":"2024-08-21T06:55:36.747Z","dependency_job_id":"d5524f39-18c5-4a1e-addb-de15009463ac","html_url":"https://github.com/codewithmirza/sample3","commit_stats":null,"previous_names":["codewithmirza/sample3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codewithmirza/sample3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmirza%2Fsample3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmirza%2Fsample3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmirza%2Fsample3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmirza%2Fsample3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewithmirza","download_url":"https://codeload.github.com/codewithmirza/sample3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmirza%2Fsample3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32052537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emscripten","webassembly","windows"],"created_at":"2024-11-16T12:23:00.465Z","updated_at":"2026-04-20T15:03:31.782Z","avatar_url":"https://github.com/codewithmirza.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Building C++ Projects with Emscripten on Windows\n\nThis guide will walk you through the process of setting up and building a C++ project with Emscripten on a Windows system. We'll use CMake for project configuration and Emscripten to compile our C++ code into WebAssembly format for web deployment.\n\n## Prerequisites\n\nBefore getting started, make sure you have the following installed on your system:\n\n- Emscripten: You can download and install Emscripten from the [official website](https://emscripten.org/docs/getting_started/downloads.html).\n- CMake: You can download and install CMake from the [official website](https://cmake.org/download/).\n\n## Step-by-Step Guide\n\n### 1. Set up Emscripten\n\nEnsure Emscripten is properly installed on your Windows system. You can follow the instructions provided on the [Emscripten Installation Guide](https://emscripten.org/docs/getting_started/downloads.html).\n\n### 2. Prepare Your Project\n\nCreate a new directory for your project and add the necessary files:\n\n- `CMakeLists.txt`: Main CMake configuration file.\n- Your C++ source files (`calc.cpp`, `calc.hpp`, `test.cpp`, etc.).\n\n### 3. Configure CMakeLists.txt\n\nInside your project directory, create a `CMakeLists.txt` file with the following contents:\n\n```cmake\ncmake_minimum_required(VERSION 3.0)\nproject(my_project)\n\n# Add your source files here\nset(SOURCES\n    calc.cpp\n    calc.hpp\n    test.cpp\n)\n\n# Set the output directory for the build\nset(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)\n\n# Create the executable\nadd_executable(my_project ${SOURCES})\n\n# Set C++ standard to C++17\ntarget_compile_features(my_project PUBLIC cxx_std_17)\n```\n\n### 4. Build Your Project with Emscripten\n\n- Open a command prompt or terminal window and navigate to your project directory.\n- Activate the latest installed version of Emscripten using the command:\n\n\n### 4. Build Your Project with Emscripten\n\n- Open a command prompt or terminal window and navigate to your project directory.\n- Activate the latest installed version of Emscripten using the command:\n`emsdk activate latest`\n\n\n- Set up the environment variables for using Emscripten:\n`emsdk_env.bat`\n\n\n\n- Generate the build files using CMake:\n```\nmkdir build\ncd build\nemcmake cmake ..\n```\n\n\n- Build your project:\n`emmake make`\n\n\n\nThis will compile your C++ code into WebAssembly format using Emscripten.  The resulting ``sample3.wasm`` can be found in `build/bin`.\n\n### Additional Notes\n\n- You can customize the project structure and CMake configuration to suit your specific requirements.\n- Emscripten provides various options and optimizations for building WebAssembly applications. Refer to the [official documentation](https://emscripten.org/docs/) for more details.\n\nFeel free to reach out if you encounter any issues or have any questions!\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithmirza%2Fsample3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithmirza%2Fsample3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithmirza%2Fsample3/lists"}