0

The title basically covers it.

The DLLs seem to be linked fine in the Linker property pages settings, based on that fact that they link without issue when using the 32-bit build platform.

I have looked into the two LNK errors online but haven't found anything that's been able to address the problem specifically.

Has anyone seen this before, or does anyone have thoughts on how to approach this?

Here are a couple of examples of the errors:

Error
LNK2001
unresolved external symbol "public: class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > __cdecl CUserContext::GetUserDisplayName(void)" (?GetUserDisplayName@CUserContext@@QEAA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@XZ)
ApplicationIMPLDLL

Error
LNK2019
unresolved external symbol "public: int __cdecl CDBManager::IsOpen(void)" (?IsOpen@CDBManager@@QEAAHXZ) referenced in function "public: __cdecl CApplicationIMPLManager::CApplicationIMPLManager(class CDBManager *)" (??0CApplicationIMPLManager@@QEAA@PEAVCDBManager@@@Z)
ApplicationIMPLDLL
Floofy
  • 1
  • 1
  • 2
    Please post the *complete* error message(s). – dxiv Dec 09 '20 at 04:25
  • Added a few examples to the original post. The full list is about 50 errors so too long to post, but the remaining errors are very similar. – Floofy Dec 09 '20 at 14:34
  • The first error suggests you don't link to the (right) MFC library, the second one is about some other library. That's still not enough detail to guess what's wrong. The fact that 32-bit builds fine could be a clue, but the .lib dependencies are defined per configuration in VS, and the 64-bit configuration is apparently missing something. – dxiv Dec 09 '20 at 19:11

1 Answers1

0

According to Microsoft Docs, there is one cause of lnk2019 and lnk2001:

You attempt to link 64-bit libraries to 32-bit code, or 32-bit libraries to 64-bit code

Libraries and object files linked to your code must be compiled for the same architecture as your code. Make sure the libraries your project references are compiled for the same architecture as your project. Make sure the /LIBPATH or Additional Library Directories property points to libraries built for the correct architecture.

based on that fact that they link without issue when using the 32-bit build platform This sentence seems to indicate that your dll is 32-bit. If so, Windows can not load a 32-bit dll into a 64-bit process.

If you have the source code of these dlls, you could compile them into 64-bit.

Of course, there is also a way to load 32-bit dll into 64-bit program. You could refer to this link for more details.

Barrnet Chou
  • 1,738
  • 1
  • 4
  • 7
  • 1
    A linker doesn't care about DLLs. It pulls data from import libraries, LIB files. – IInspectable Dec 09 '20 at 07:23
  • @IInspectable,Link error 2001 indicates that the lib file is not found or is not correct. You couldn't link a 32-bit library with a 64-bit executable or DLL (or a 32-bit executable to a 64-bit DLL or vice versa). Whether you have rebuilded the DLL for a 64 bit target? – Jeaninez - MSFT Dec 11 '20 at 07:09