{"id":22017853,"url":"https://github.com/lentil32/cs50-minimal-setup","last_synced_at":"2026-04-19T14:01:26.178Z","repository":{"id":214770184,"uuid":"737319536","full_name":"lentil32/cs50-minimal-setup","owner":"lentil32","description":"CS50 Minimal Setup for macOS and Linux","archived":false,"fork":false,"pushed_at":"2024-01-05T18:35:33.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T09:34:33.648Z","etag":null,"topics":["c","cs50","ocw"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/lentil32.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}},"created_at":"2023-12-30T15:53:06.000Z","updated_at":"2025-01-22T01:38:10.000Z","dependencies_parsed_at":"2024-01-04T07:32:05.547Z","dependency_job_id":null,"html_url":"https://github.com/lentil32/cs50-minimal-setup","commit_stats":null,"previous_names":["lenntil/cs50-minimal-setup","lenntil2/cs50-minimal-setup","lentil32/cs50-minimal-setup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lentil32/cs50-minimal-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lentil32%2Fcs50-minimal-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lentil32%2Fcs50-minimal-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lentil32%2Fcs50-minimal-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lentil32%2Fcs50-minimal-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lentil32","download_url":"https://codeload.github.com/lentil32/cs50-minimal-setup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lentil32%2Fcs50-minimal-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32009239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"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":["c","cs50","ocw"],"created_at":"2024-11-30T05:08:25.472Z","updated_at":"2026-04-19T14:01:26.106Z","avatar_url":"https://github.com/lentil32.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CS50 Minimal Setup for macOS and Linux\n\n## Prerequisites\nThis guide assumes that:\n- You can use command line.\\\n  [Command line crash course - Learn web development | MDN](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Understanding_client-side_tools/Command_line)\n- Git is installed.\\\n  [Git - Installing Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n\n## Getting started\n\nBefore starting, make sure that you are in the project directory containing [test.c](./test.c) (or some C code to compile).\n\nFirst, clone the `libcs50` git repository:\n\n```sh\ngit clone https://github.com/cs50/libcs50.git\n```\n\nThen, your project directory will be like (ommitted unnecessary ones):\n\n```console\n$ tree\n.\n├── README.md\n├── build.sh\n├── libcs50\n│   ├── LICENSE\n│   ├── Makefile\n│   ├── README.md\n│   ├── src\n│   │   ├── cs50.c\n│   │   └── cs50.h\n│   └── tests\n└── test.c\n```\n\n`cd` into the cloned directory (`libcs50`) and build:\n\n```sh\ncd libcs50\nmake\n```\n\nThen, your build directory will be like:\n\n```console\n$ cd build\n$ tree\n.\n├── include\n│   └── cs50.h\n├── lib\n│   ├── libcs50-11.0.2.dylib\n│   ├── libcs50.a\n│   └── libcs50.dylib -\u003e libcs50-11.0.2.dylib\n└── src\n    └── cs50.c\n```\n\nTo build a C program, you need `cs50.h` and either `libcs50-11.0.2.dylib` (for Dynamic Linking) or `libcs50.a` (for Static Linking).\n\n## Option 1. Dynamic linking\n\nPlace `libcs50-11.0.2.dylib` in your CS50 project directory. The contents of the project directory will look like:\n\n```console\n$ ls\ncs50.h        test.c        libcs50-11.0.2.dylib\n```\n\nBuild `test.c` as follows:\n\n```sh\ncc -o test test.c -lcs50\n```\n\n## Option 2-1. Static linking\n\nPlace `libcs50.a` in your CS50 project directory. The contents of the project directory will be:\n\n```console\n$ ls\ncs50.h        test.c        libcs50.a\n```\n\nBuild `test.c` as follows:\n\n```sh\ncc -o test test.c libcs50.a\n```\n\n## Option 2-2. Static linking - Using flags to link libraries\n\nUse the following flags in your compile command:\n\n- `-I` for include path.\n\nBuild `test.c` as follows:\n\n```sh\ncc -o test test.c -I./libcs50/build/include ./libcs50/build/lib/libcs50.a\n```\n\nFor an enhanced version, see [Build Script](./build.sh).\n\n## Running the program\n\nAfter building, you can run the `test` binary file with:\n\n```sh\n./test\n```\n\n## Why?\n\n1. A minimal setup will lower the barrier to C programming.\n2. You don't want to mess up the system's `lib` directory with a library that will never be reused.\n3. In macOS, there are some problems with `dyld` (Dynamic Link Editor). For example, if you have disabled SIP (System Integrity Protection), you might encounter issues when following the methods described in official guides.\n\n## References\n\n- [cs50/libcs50: This is CS50's Library for C.](https://github.com/cs50/libcs50)\n- [CS50 Library for C — CS50 Docs](https://cs50.readthedocs.io/libraries/cs50/c/)\n\n## See also\n\n- [Mac make install error: No such file or directory · Issue #142 · cs50/libcs50](https://github.com/cs50/libcs50/issues/142)\n- [How to use cs50.h in my local VSCode environment? · Issue #189 · cs50/libcs50](https://github.com/cs50/libcs50/issues/189)\n- [CS50 Manual Pages](https://manual.cs50.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flentil32%2Fcs50-minimal-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flentil32%2Fcs50-minimal-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flentil32%2Fcs50-minimal-setup/lists"}