Some of the more important linker options a beginner should know about are:-
-g
This instructs the linker to generate additional information
to help when debugging. See section 6.1.6.
-o executable name
This tells the linker the name to give to the output file, for example:-
-o Zoo.exe
-Ldirectory
This tell the linker to look in the directory directory for
libraries specified with the -l option (see below). The option can
be used any number of times to define additional directories to be
searched e.g.:-
g++ -L/cern/root/lib -LMyCode/lib ...
-llibrary_name
This tell the compiler to look for a library to load. It takes library_name and adds the prefix ``lib'' and the suffix either .a or
.so and then looks for the library in each of the directories
specified with the -L option. For example:-