These days I am playing with a thread library and trying to implement some functions. One lesson says that to run the program, use:
gcc -lpthread -lrt -lc -lm project1.c scheduler.c -o out
First of all, I need a deep understanding of what gcc does on each line,
lpthread is used for what? what are the contributions of lrt -lc -lm?
project1.c and scheduler.c compiled together, and what should I understand? I checked the code and any of them are not included in project1.c or scheduler.c.
- as a result, clearly gives a "way out".
Secondly, the author claims that you must use
./out number filename (For example, ./out 2 sample.txt)
To understand this, as I understand it, the main function gets a number and sample.txt as input. (?)
Thanks for your answers and let me know.