You need both -L and -l for X11. One tells it where to look for libriaries, the other tells it which libraries you want to link.
But dupicate symbols might be another problem. You might need to clean to start over will all the parameters correct.
I don't know why the instructions have you compile and link in 2 sperate steps...
|