I'm taking the course of HarvardX: CS50x Introduction to Computer Science. Normally for doing this course you have to use a virtual machine for running a Fedora system called the cs50 appliance, with all the things made easy, but I already use Kubuntu so I downloaded clang and the cs50 library and I want to change the default options of
make to include the library and stop when there are errors in the c program that I try to compile. In the appliance the make command does:
clang -ggdb3 -00 -std=c99 -Wall -Werror -argv-2.c -lcs50 -lm -o argv-2. It would be nice if you can explain what should be included and why. When I compile a .c file using make, it doesn't load the cs50 library and I get: undefined function ...
I tried writing
$ nano ~/.bashrc. Then went to the end of the file and put
#CS50 alias for C compiling: alias makec='gcc -ggdb3 -std=c99 -Wall -Werror -argv-2.c -lcs50 -lm -o -argv-2'
$ source .bashrc
When I do
$ makec hello now it says:
gcc: error: hello: No such file or directory gcc: error: unrecognized command line option ‘-argv-2.c’