c++visual-studiodll32bit-64bitunresolved-external

32-bit to 64-bit : LNK2019 error, how to retrieve relevant information


I'm working on a 32-bit C++ application, which I'm converting to a 64-bit application (simply choose another configuration, copy and adapt all relevant settings, and try to get it to build), and now I get stuck on linker error LNK2019 "unresolved external symbol ... referenced in function ...", and I'd like to get more information:
I have already re-built the application in 32-bit, and I've found the referred function, but when I press F12, Shift+F12 or Ctrl+F12 I don't see where the implementation is retrieved from.

I think that the function's implementation is somewhere inside a DLL, but I want to be sure of it (once this is confirmed, I can look for the corresponding settings, defining the location, and copy this setting for my 64-bit configuration).

Maybe the question can be reformulated in the following way: in case a function is retrieved from a DLL, is it possible to know in which DLL this function is implemented?


Solution

  • Hans, the advise about the *.map file was a life saver: this allowed me to know in which file the mentioned function was to be found.
    Obviously, that was not the end of it: the mentioned file was a DLL, while there is no reference towards the DLL itself, but towards a LIB file, who redirects towards the DLL.
    In case this is not difficult enough: the function itself was a __imp_ function, and there seems to be a catch there:

    Finally I solved the issue by checking the build output (compare LIB= and PATH= entries and make sure they are similar for both cases: when there is a reference to the 32-bit libraries in one output, there should be a reference to the 64-bit libraries in the other output).
    In the 32-bit output, I saw that the linker was referring to a lib, which he did not do in case of the 64-bit linking: I added the corresponding lib in the project's configuration (Configuration properties, Linker, Input, Additional Dependencies), and this finally solved the issue.