In Visual Studio 2012 what is the difference between Librarian and Linker?

Are the Librarian and the Linker section the same? On the documentation I searched on google I only see Linker mentioned.

They are almost the same. Option Librarian is enabled when your project is going to be a static lib. Option Linker is for executables and dynamic (link) libraries (dll).

Dynamic libraries will be linked dynamic to the executable you are building, which means the dll have to be around while execution. Static libraries on the other hand will be part of the executable. Static libraries mustn't be linked to some dynamic lib, since the linkage should be done while generating the executable. Otherwise it would cause ambiguity. This is why the Librarian options are reduced. (e.g. there is no Input options).

Maybe I have something configured wrong? Or in this post the answer didn't refer to Native C++?

The project from the linked post generates a dll (dynamic link library), not a static lib. Check your settings in Configuration Properties -> General -> Configuration Type.


You see the Librarian section when you created a static library project. Do beware that such a project is incompatible with code built with the /clr option, managed code is linked at runtime, not build time. Trying to use such the .lib file gives pretty hard to diagnose linker errors when you try to build an assembly. It is okay if you use it for pure native code, the kind built without /clr in effect.

There's very little to a .lib file, it is just a bag of .obj files. Think of it as a .zip archive with a cr*ppy compression rate. The lib.exe utility is there to get .obj and .lib files added and removed from the .lib, think of it as winzip.

So there are indeed very few settings in the General section, there's just not much to lib.exe. Pretty much a one-to-one mapping to the command line options that lib.exe takes. The /MACHINE option (aka Target Machine setting) is not required, it is fixed by the compiler you used. It is documented as:

However, in some circumstances, LIB cannot determine the machine type and issues an error message. If such an error occurs, specify /MACHINE.

So scratch that idea. It is entirely locked in by the Platform selection you used for your project. Standard ones in VS are Win32 to generate 32-bit code and x64 to generate 64-bit code.