From: Tor L. <tm...@ik...> - 2010-10-26 11:11:01
|
> suppose I've got a static library file named libMylib.a, what's the > difference between the two following commands? > g++ -o libMylib.a > g++ -lMylib Neither of those commands make any sense as written. Did you leave out a lot of the command lines? g++ -o libMylib.a doesn't make sense even as just a the initial part of the command, because after the -o option should follow the name of the output file, which will be either an executable (which for Windows can also mean a DLL) or an object file, never an archive. Assuming you actually also specify one or several source and/or object files, g++ -o libMylib.a would create an executable called libMylib.a which is as such legal, but extremely confusing and certainly not what you want. --tml |