link file means?
Compile source files, you get object files.
Link object files, you get static/dynamic libraries or executable files.
(preprocessing and assembly are ignored in this explaination.)
When you execute g++ foo.cpp, the tool chain helps you to compile and then link. However, after the success of compilling, ld, the linker, reports the symbol undefined error. This is because that in your source file, you request some functions or variables that are defined in other libraries, but you failed to link them together.
As stated by Mester, you have to get the libraries (by sudo apt-get install bar), and then explicitly link them with your object file(s) (by -lbar).
Google is your friend.