{"id":32664097,"url":"https://github.com/retifrav/csharp-cpp-example","last_synced_at":"2026-05-08T06:33:23.572Z","repository":{"id":321030634,"uuid":"1084169533","full_name":"retifrav/csharp-cpp-example","owner":"retifrav","description":"An example of using a C++ library inside .NET/C# application.","archived":false,"fork":false,"pushed_at":"2025-10-27T11:18:17.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-27T12:29:49.976Z","etag":null,"topics":["cmake","cpp","csharp","dotnet"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/retifrav.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-27T10:16:07.000Z","updated_at":"2025-10-27T11:18:21.000Z","dependencies_parsed_at":"2025-10-27T12:29:53.885Z","dependency_job_id":null,"html_url":"https://github.com/retifrav/csharp-cpp-example","commit_stats":null,"previous_names":["retifrav/csharp-cpp-example"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/retifrav/csharp-cpp-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retifrav%2Fcsharp-cpp-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retifrav%2Fcsharp-cpp-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retifrav%2Fcsharp-cpp-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retifrav%2Fcsharp-cpp-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retifrav","download_url":"https://codeload.github.com/retifrav/csharp-cpp-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retifrav%2Fcsharp-cpp-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282070789,"owners_count":26608933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cmake","cpp","csharp","dotnet"],"created_at":"2025-10-31T23:01:22.016Z","updated_at":"2026-05-08T06:33:23.557Z","avatar_url":"https://github.com/retifrav.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++ in .NET/C#\n\nAn example of using a C++ library inside a .NET/C# project.\n\n\u003c!-- MarkdownTOC --\u003e\n\n- [Building and running](#building-and-running)\n    - [On Windows](#on-windows)\n    - [On platforms other than Windows](#on-platforms-other-than-windows)\n        - [Desktop](#desktop)\n        - [MAUI](#maui)\n\n\u003c!-- /MarkdownTOC --\u003e\n\nMore information in the following [article](https://decovar.dev/blog/2025/11/11/cpp-library-in-csharp/).\n\n## Building and running\n\n### On Windows\n\nAssuming Git BASH environment:\n\n``` sh\n$ cd /path/to/csharp-cpp-example/\n$ mkdir build \u0026\u0026 cd $_\n$ cmake -G \"Visual Studio 17 2022\" \\\n    -DCMAKE_TOOLCHAIN_FILE=\"$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake\" \\\n    -DVCPKG_APPLOCAL_DEPS=0 \\\n    ..\n$ cmake --build . --config Release\n$ ./csharp/application/Release/applctn.exe -j ./csharp/application/Release/grils.json\n```\n\n### On platforms other than Windows\n\n#### Desktop\n\nWorks equally fine on Mac OS and GNU/Linux:\n\n``` sh\n$ cd /path/to/csharp-cpp-example\n$ mkdir build \u0026\u0026 cd $_\n\n$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \\\n    -DCMAKE_TOOLCHAIN_FILE=\"$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake\" \\\n    ..\n$ cmake --build .\n\n$ mkdir ./csharp \u0026\u0026 cd $_\n$ dotnet build ../../csharp/application/applctn.csproj \\\n    --artifacts-path . \\\n    --configuration Release\n$ ./bin/applctn/release/applctn -j ./bin/applctn/release/grils.json\n```\n\n#### MAUI\n\nTargetting iOS simulator:\n\n``` sh\n$ cd /path/to/csharp-cpp-example\n$ mkdir build \u0026\u0026 cd $_\n\n$ cmake -G Xcode \\\n    -DCMAKE_TOOLCHAIN_FILE=\"$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake\" \\\n    -DVCPKG_TARGET_TRIPLET=\"arm64-ios-simulator\" \\\n    -DCMAKE_SYSTEM_NAME=\"iOS\" \\\n    -DCMAKE_OSX_SYSROOT=\"iphonesimulator\" \\\n    -DCMAKE_OSX_ARCHITECTURES=\"arm64\" \\\n    ..\n$ cmake --build . --config Debug\n\n$ mkdir ./maui \u0026\u0026 cd $_\n$ MD_APPLE_SDK_ROOT='/Users/vasya/Applications/Xcode-26.0.0.app' \\\n    dotnet build ../../csharp/maui/maui.csproj \\\n    --artifacts-path . \\\n    --configuration Debug \\\n    -f net9.0-ios \\\n    /p:ApplicationTargetPlatform=ios-simulator\n```\n\nhere:\n\n- `MD_APPLE_SDK_ROOT` is only needed if .NET/MAUI didn't like your \"main\" Xcode, so you needed to install a different version;\n- the resulting application bundle will be at `./bin/maui/debug_net9.0-ios/maui.app`;\n- instead of `Debug` you might of course prefer building `Release`, but that build might never finish or/and exhaust all your disk space.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretifrav%2Fcsharp-cpp-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretifrav%2Fcsharp-cpp-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretifrav%2Fcsharp-cpp-example/lists"}