How does the linker resolve ambiguities when linking * .libs?

after a very long long time spent with unresolved external files, I found that VS2010 was linking the wrong .lib file.

Files, unfortunately, were named with the same name.

A folder with a linked (unwanted) lib was set in the project properties A folder with an unlinked (wanted) library was inherited from another properties page

The desired library was a newer date, the unwanted one was a lot older.

Linker chose unnecessary (as indicated above).

What are the rules for linking libraries? Should the linker give at least a warning about some ambiguity?

edit: character defined ONLY in NEW lib. And NEW lib searches only when I delete OLD lib (no linker settings changed)

0
source share
1 answer

Think of the Linker LIB as a compiler header. A LIB has a signature for exported characters only if it is not a static LIB. LIB files do not have any version for them.

Two LIB files can have the same name, for example, two header files. This is you, the programmer who must use the correct LIB / header file. If the linker does not find all the characters or the characters are incorrect, it will report an error (just like the compiler will do for inconsistent characters in the header file).

0
source

All Articles