Skip to content

Commit

Permalink
Quartz sync: Jan 14, 2025, 4:49 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
luclisson committed Jan 14, 2025
1 parent 7d2ddb8 commit 53ef65f
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions content/subnotes/Getting started.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,49 @@ int main() {

### Compiler

To run you C programs outside of your IDE e.g. visual studio code, you have to install a c compiler. Here, we will provide you with some instructions and resources how to install a compiler and how to use a compiler.

#### **How to install a compiler**
Since there isn't a official c compiler published by c, we have to download a third party compiler.

Windows:
- you can install [MinGW](https://sourceforge.net/projects/mingw/) and select the c compiler in the installation process
- you have to add your c compiler installation path to your environment variables in order to use it in powershell
we found a great youtube video which shows excactly how to install a c compiler on windows.

MacOS/Unix:
- we recommend to install gcc via a package manager
for mac you could use [homebrew](https://brew.sh/)
your favourite package manager should work perfectly fine as well
```shell
brew install ghc
```
- the command "ghci" should work (if not check your ~/.zshrc file and add ghci as export path)

#### How to compile a c file
**windows**
1. check your compiler
```shell
gcc --version
```
2. open the files location in the terminal
3. compile the c file
```shell
gcc myFile.c
```
--> this will create a .exe file
4. run the .exe file
macOS/Unix
1. check your compiler
```shell
gcc --version
```
2. open the file's location in the terminal
3. compile the c file
```shell
gcc myFile.c -o myFile
```
4. run the compiled file
```shell
./myFile
```

0 comments on commit 53ef65f

Please sign in to comment.