Stop Undefined References
There are many reasons why you might receive undefined references. The typical reason is that you have not specified an appropriate library or your command line order is incorrect. In order for a library to resolve references the dependency for the library must precede the library in the command line order.
gcc -o foo -L/path/to/mylib bar.o -lbaz