c - lib dependencies and their order -


at times if don't list libs in order inside makefile, fails.

the reason being - definition should come before use.

how determine correct order?

actually, when linking libraries, use should come before definition. unresolved symbols need known before library file providing definitions processed.

what comes order, i'm afraid have manually. if liba depends on libb (i.e. liba uses symbols libb), have link in order: -la -lb.

this matter of documentation. well-documented library states other libraries depends on, can figure out correct linking order.

if don't want read documentation or there no documentation available, trial , error option :)


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -