error LNK2019 : unresolved external symbol. Adding the reference seems to double the definitions <p>I am working with a library, which is used by an application. When I compile the library, no compilation error is shown, but when I try to compile the application, the linker error LNK2019 is thrown, mentioning a function which is not present in the library.</p> <p>This can mean two things : <li> either the library is not found <li> either the library is found but the mentioned function is not present.</p> <p>I have already tried to recompile the application after having moved the library, and then he complains that the library is not found, so surely he finds the library but not the function inside.</p> <p>Further in the "Error List" window, next to the linker error message, I see the following information in the "File" column: <code>library.lib(object_file.obj)</code>, which indicates that he knows where he should look for that function (the mentioned function is not present in "object_file.c").</p> <p>When I include a file, containing the definition of that function, and I re-compile the library, I receive the following warning message <code>warning LNK4006: "int function(arguments) already defined in other_source_file.obj; second definition ignored</code>, although in "other_source_file.c" that function is not there.</p> <p>So I'm wondering how this is possible: <li> A function is missing, but when I add it, it seems to be present two times. <li> How does the compiler/linker know where he should be looking for that particular function?</p> <p>You're right, people, without any source code excerpt it's very difficult to handle this question. The function I have issues with, is the function "EXT_snprintf", which is referred upon by the function "snprintf" as you can see here:</p> <pre><code>#define snprintf _EXT_snprintf_f extern int snprintf(char* str, size_t size, const char* format, ...); </code></pre> <p>I've found this piece of code in a header file, belonging to the library. I don't find any implementation of <code>_EXT_snprintf_f</code> anywhere.</p> <p>As for the language, I have found the "/TP" flag in both compilation settings, mentioning that the compiler needs to treat the library and the application as C++ sources. (I've removed the "C" tag from the question)</p> <p>Does anybody have an idea?<br/> Thanks</p>