Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update README.md: add section "on Windows OS" #246

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,31 @@ $ yum install libcs50
By default, we install to `/usr/local`. If you'd like to change the installation location, run
`sudo DESTDIR=/path/to/install make install` as desired.

### On Windows OS

##### Prerequisites ([how](https://code.visualstudio.com/docs/cpp/config-mingw#_prerequisites))

* Install MinGM
* Add the path to your Mingw-w64 bin folder to the Windows PATH environment variable
Comment on lines +41 to +44

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Move how in the content
  2. MinGM or MinGW ??
Suggested change
##### Prerequisites ([how](https://code.visualstudio.com/docs/cpp/config-mingw#_prerequisites))
* Install MinGM
* Add the path to your Mingw-w64 bin folder to the Windows PATH environment variable
##### Prerequisites
* Install MinGW
* Add the path to your Mingw-w64 bin folder to the Windows PATH environment variable ([how](https://code.visualstudio.com/docs/cpp/config-mingw#_prerequisites))


##### Steps

0. Add files [cs50.h](https://github.com/cs50/libcs50/blob/main/src/cs50.h), [cs50.c](https://github.com/cs50/libcs50/blob/main/src/cs50.c)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
0. Add files [cs50.h](https://github.com/cs50/libcs50/blob/main/src/cs50.h), [cs50.c](https://github.com/cs50/libcs50/blob/main/src/cs50.c)
0. Add files [cs50.h](https://github.com/cs50/libcs50/blob/main/src/cs50.h), [cs50.c](https://github.com/cs50/libcs50/blob/main/src/cs50.c) in the directory of your source code (`.c`) files

1. Include cs50.h

#include "cs50.h"

2. Compiler (Command line)

gcc -o myCode myCode.c cs50.c

3. Run Program (Command line)

.\myCode

More and [Source](https://github.com/cs50/libcs50/issues/189#issuecomment-737173845)


## Troubleshooting
1. If, when compiling a program, you see `/usr/bin/ld: cannot find -lcs50`:
Add `export LIBRARY_PATH=/usr/local/lib` to your `.bashrc`.
Expand Down