Last active
October 28, 2024 12:39
-
-
Save levpa/1acfef64459aa86468e489ff7024e9d6 to your computer and use it in GitHub Desktop.
CS50 course WSL clang setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install make and clang | |
sudo apt install make clang | |
# cs50.h library install | |
curl -s https://packagecloud.io/install/repositories/cs50/repo/script.deb.sh | sudo bash | |
sudo apt install libcs50 | |
# put this into ~/.bashrc | |
export CC="clang" | |
export CFLAGS="" | |
export LDLIBS="-lcrypt -lcs50 -lm" | |
# apply your .bashrc configuration | |
source ~/.bashrc | |
# build your C code with: | |
make foo | |
# run your C code with: | |
./foo | |
# last one: for code completion, compile errors and warnings, go-to-definition and cross references, hover information and inlay hints, include management, code formatting, simple refactorings | |
# install this plugin in VS Code: llvm-vs-code-extensions.vscode-clangd | |
# you will be asked to install clang local server also... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment