How to statically link or dynamically link libraries in your c++ program?

How to statically link or dynamically link libraries in your c++ program?