{"id":25208117,"url":"https://github.com/1010code/wine-mingw-linux-cpp","last_synced_at":"2026-01-19T11:02:06.512Z","repository":{"id":256202117,"uuid":"854554073","full_name":"1010code/wine-mingw-linux-cpp","owner":"1010code","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-31T05:40:39.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T04:20:03.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1010code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09-09T11:38:27.000Z","updated_at":"2024-10-31T05:40:43.000Z","dependencies_parsed_at":"2024-09-09T15:44:15.490Z","dependency_job_id":null,"html_url":"https://github.com/1010code/wine-mingw-linux-cpp","commit_stats":null,"previous_names":["1010code/wine-mingw-linux-cpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/1010code/wine-mingw-linux-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1010code%2Fwine-mingw-linux-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1010code%2Fwine-mingw-linux-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1010code%2Fwine-mingw-linux-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1010code%2Fwine-mingw-linux-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1010code","download_url":"https://codeload.github.com/1010code/wine-mingw-linux-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1010code%2Fwine-mingw-linux-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28565876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"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":[],"created_at":"2025-02-10T12:18:52.559Z","updated_at":"2026-01-19T11:02:06.492Z","avatar_url":"https://github.com/1010code.png","language":"CMake","readme":"# [教學] 在 Linux 下執行 MinGW 編譯的 C++ .exe 檔案\n\n## 編譯\n這是一份用C++撰寫的main主程式，此專案架構包刮Google單元測試。以下透過 Mingw toolchain 編譯，使得可以在Linux系統中編譯 Windows Mingw的執行檔。\n\n```sh\n# 配置項目\ncmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=toolchain-mingw64.cmake\n# 建構項目\ncmake --build build\n```\n\n編譯結果後會在該資料夾下產生`build`資料夾，兩份執行檔分別會在。\n- build/bin/main.exe\n- build/test/unit_test.exe\n\n## 如何在 Linux 下執行 MinGW 編譯的 C++ .exe 檔案\n可以參考以下[文章](https://andy6804tw.github.io/2024/08/31/wine-mingw-linux-cpp/)在Linux系統下安裝wine模擬 Windows 環境來執行這些檔案。\n\n安裝成功後即可執行：\n\n```sh\n# 執行主程式\nwine build/bin/main.exe\n\n```\n\n執行結果：\n```\nhello world!\n```\n\n\n\n```sh\n# 執行單元測試\nwine build/test/unit_test.exe\n```\n\n執行結果：\n```\n[0;32m[==========] [mRunning 1 test from 1 test suite.\n[0;32m[----------] [mGlobal test environment set-up.\n[0;32m[----------] [m1 test from PublicSum\n[0;32m[ RUN      ] [mPublicSum.test1\n[0;32m[       OK ] [mPublicSum.test1 (0 ms)\n[0;32m[----------] [m1 test from PublicSum (9 ms total)\n\n[0;32m[----------] [mGlobal test environment tear-down\n[0;32m[==========] [m1 test from 1 test suite ran. (39 ms total)\n[0;32m[  PASSED  ] [m1 test.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1010code%2Fwine-mingw-linux-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1010code%2Fwine-mingw-linux-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1010code%2Fwine-mingw-linux-cpp/lists"}