I am new to C. I am coding in Ubuntu 12.04. I've just faced this problem and solved it using the solution provided for that question(using -lncurses flag while compiling with gcc
).
My questions are,
Do we have to explicitly mention every library used in our program as a flag to gcc so that it can link to object file ?
If we have to do it why to write header files on the top our program like
#include<stdio.h> or
#include` ?Do we have to maintain some order in which this library flags are written in
gcc
command. Because of a statement in this answer says that order matters? What decides the order of flags ?
Thanks in advance.