Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am configuring my Projects to build with x86 and x64 bits, in order to do that I had to change the Target Machine for the different Configurations.

I was trying to find where to set the Target Machine for my Native C++ Libraries and I found this post.

However I don't have a Linker in the Native C++ Library projects, I have the "Configuration Properties -> Linker -> Advanced -> Target Machine" option in the C++/CLI projects only.

In the Native C++ Library projects I have a "Librarian" section. I searched and I found that the Target Machine is in: Configuration Properties -> Librarian -> General -> Target Machine.

The Librarian section seems to have less options than Linker.

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

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

like image 317
Dzyann Avatar asked Feb 25 '14 20:02

Dzyann


1 Answers

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.

like image 174
user1810087 Avatar answered Sep 28 '22 08:09

user1810087