{"id":27238131,"url":"https://github.com/dialog-if/dialogc_vs2022_mingw","last_synced_at":"2026-02-09T22:05:02.834Z","repository":{"id":269464123,"uuid":"907492353","full_name":"Dialog-IF/dialogc_vs2022_mingw","owner":"Dialog-IF","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-23T18:08:03.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-19T21:42:46.211Z","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/Dialog-IF.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-12-23T17:49:09.000Z","updated_at":"2024-12-23T18:08:06.000Z","dependencies_parsed_at":"2024-12-23T19:30:01.518Z","dependency_job_id":null,"html_url":"https://github.com/Dialog-IF/dialogc_vs2022_mingw","commit_stats":null,"previous_names":["dialog-if/dialogc_vs2022_mingw"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Dialog-IF/dialogc_vs2022_mingw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dialog-IF%2Fdialogc_vs2022_mingw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dialog-IF%2Fdialogc_vs2022_mingw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dialog-IF%2Fdialogc_vs2022_mingw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dialog-IF%2Fdialogc_vs2022_mingw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dialog-IF","download_url":"https://codeload.github.com/Dialog-IF/dialogc_vs2022_mingw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dialog-IF%2Fdialogc_vs2022_mingw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29283033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T21:57:15.303Z","status":"ssl_error","status_checked_at":"2026-02-09T21:57:11.537Z","response_time":56,"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-04-10T19:00:00.460Z","updated_at":"2026-02-09T22:05:02.816Z","avatar_url":"https://github.com/Dialog-IF.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Setting up Dialog to compile in Visual Studio 2022 with mingw64/32 or ucrt64\n\n1. Install *MSYS2* in `C:\\msys64` (https://www.msys2.org/). Use default settings for installation.\n\n2. Open a *MSYS2* (any) terminal and install gcc toolchain for both ucrt64 and mingw64.\n\n```\n    pacman -S mingw-w64-ucrt-x86_64-gcc\n    pacman -S mingw-w64-x86_64-gcc\n    pacman -S mingw-w64-i686-gcc\n    pacman -S make\n```\n\n3. Use the *MSYS2 MINGW64* terminal if you want to compile and link with `MSVCRT` for C (compatible with pre Win10 but lacks some features). Use *MSYS2 UCRT64* terminal if you want to compile and link with `UCRT` for C (Win10+, more \"modern\", UTF8). See https://www.msys2.org/docs/environments/ for more details.\n\n4. To use `gcc` and Linux style commands in Windows CMD or PowerShell windows, add `C:\\msys64\\ucrt64\\bin` and `C:\\msys64\\usr\\bin` to the path environment variable (*Settings/System/Advanced/Environment Variables*).\n\n5. Create new *CMake* project in *Visual Studio 2022* (check box for `place solution and project in same directory`).\n\n6. Delete the dummy files `*.cpp` and `*.h` that was created in the new project.\n\n7. Copy the *Dialog* `\\src` directory to the newly created project.\n\n8. Add configurations for *Mingw64* and *Ucrt64* to `CMakePresets.json`.\n```\n    {\n      \"name\": \"Mingw64-debug\",\n      \"displayName\": \"Mingw64 Debug\",\n      \"inherits\": \"windows-base\",\n      \"environment\": {\n        \"PATH\": \"C:/msys64/mingw64/bin;$penv{PATH}\"\n      },\n      \"cacheVariables\": {\n        \"CMAKE_C_COMPILER\": \"gcc.exe\",\n        \"CMAKE_CXX_COMPILER\": \"g++.exe\",\n        \"CMAKE_BUILD_TYPE\": \"Debug\"\n      }\n    },\n    {\n      \"name\": \"Mingw64-release\",\n      \"displayName\": \"Mingw64 Release\",\n      \"inherits\": \"Mingw64-debug\",\n      \"cacheVariables\": {\n        \"CMAKE_BUILD_TYPE\": \"Release\"\n      }\n    },\n    {\n      \"name\": \"Ucrt64-debug\",\n      \"displayName\": \"Ucrt64 Debug\",\n      \"inherits\": \"windows-base\",\n      \"environment\": {\n        \"PATH\": \"C:/msys64/ucrt64/bin;$penv{PATH}\"\n      },\n      \"cacheVariables\": {\n        \"CMAKE_C_COMPILER\": \"gcc.exe\",\n        \"CMAKE_CXX_COMPILER\": \"g++.exe\",\n        \"CMAKE_BUILD_TYPE\": \"Debug\"\n      }\n    },\n    {\n      \"name\": \"Ucrt64-release\",\n      \"displayName\": \"Ucrt64 Release\",\n      \"inherits\": \"Ucrt64-debug\",\n      \"cacheVariables\": {\n        \"CMAKE_BUILD_TYPE\": \"Release\"\n      }\n    }\n```\n\n9. Change `CMakeList.txt` (`add_definitions` and `add_executable` are new and/or changed from the default).\n```\n\t# CMakeList.txt : CMake project for dialogc, include source and define\n\t# project specific logic here.\n\t#\n\tcmake_minimum_required (VERSION 3.8)\n\t\n\t# Enable Hot Reload for MSVC compilers if supported.\n\tif (POLICY CMP0141)\n\t  cmake_policy(SET CMP0141 NEW)\n\t  set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT \"$\u003cIF:$\u003cAND:$\u003cC_COMPILER_ID:MSVC\u003e,$\u003cCXX_COMPILER_ID:MSVC\u003e\u003e,$\u003c$\u003cCONFIG:Debug,RelWithDebInfo\u003e:EditAndContinue\u003e,$\u003c$\u003cCONFIG:Debug,RelWithDebInfo\u003e:ProgramDatabase\u003e\u003e\")\n\tendif()\n\t\n\tadd_definitions(\"-DVERSION=\\\"0m/03\\\"\")\n\t\n\tproject (\"dialogc\")\n\t\n\t# Add source to this project's executable.\n\tadd_executable (dialogc \"src/aavm.c\"\n\t\t\t\t\t\t\t\"src/accesspred.c\"\n\t\t\t\t\t\t\t\"src/arena.c\"\n\t\t\t\t\t\t\t\"src/ast.c\"\n\t\t\t\t\t\t\t\"src/backend.c\"\n\t\t\t\t\t\t\t\"src/backend_aa.c\"\n\t\t\t\t\t\t\t\"src/backend_z.c\"\n\t\t\t\t\t\t\t\"src/blorb.c\"\n\t\t\t\t\t\t\t\"src/compile.c\"\n\t\t\t\t\t\t\t\"src/crc32.c\"\n\t\t\t\t\t\t\t\"src/dumb_output.c\"\n\t\t\t\t\t\t\t\"src/dumb_report.c\"\n\t\t\t\t\t\t\t\"src/eval.c\"\n\t\t\t\t\t\t\t\"src/frontend.c\"\n\t\t\t\t\t\t\t\"src/parse.c\"\n\t\t\t\t\t\t\t\"src/runtime_z.c\"\n\t\t\t\t\t\t\t\"src/unicode.c\"\n\t)\n\t\n\tif (CMAKE_VERSION VERSION_GREATER 3.12)\n\t  set_property(TARGET dialogc PROPERTY CXX_STANDARD 20)\n\tendif()\n\t\n\t# TODO: Add tests and install targets if needed.\n```\n\n10. Compile and debug for *Mingw64* or *Ucrt64* should now work. Arguments for debugging can be added under menu *Debug/Debug and Launch Settings for \\\u003cproject\u003e*.\n```\n  {\n    \"version\": \"0.2.1\",\n    \"defaults\": {},\n    \"configurations\": [\n      {\n        \"type\": \"default\",\n        \"project\": \"CMakeLists.txt\",\n        \"projectTarget\": \"dialogc.exe\",\n        \"name\": \"dialogc.exe\",\n        \"args\": [\n          \"--version\"\n        ]\n      }\n    ]\n  }\n```\n\n\n\nThe debugger won't run in VS2022 yet, but if you want to compile it in *MSYS2* you need to:\n\n1. Install mingw32 gcc\n```\n    pacman -S mingw-w64-i686-gcc\n```\n2. Start the *MSYS2 MINGW32* environment with `mingw32.exe`.\n\n3. `make dgdebug.exe` in the *Dialog* `/src`.\n\nTo run *dgdebug* you need `Glk.dll` and `ScaleGfx.dll` in same directory as the `dgdebug.exe`. Of course `dialogc` can also be compiled for 32-bit as above or with `make dialogc`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdialog-if%2Fdialogc_vs2022_mingw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdialog-if%2Fdialogc_vs2022_mingw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdialog-if%2Fdialogc_vs2022_mingw/lists"}