MFC DLL link error

Hello,

I have experienced the following problem: I have created an MFC DLL which is linked to a static library. When I try to use functions from the .LIB I get the following error: Error 1 error LNK2019: unresolved external symbol

Both libraries are using Multi-Threaded debug DLL as runtime library and the .LIB is included in the additional dependencies of the .DLL. Both libraries are smart device projocts and they are compiled for the same processor. The reason for using the LIB is that it contains much needed fuctionality provided by a third party.

I have done the exact same thing for a Win32 application and it works perfectly. Any help would be appreciated

Jaqq


Answer this question

MFC DLL link error

  • gotech.voip

    hi ,

    where exactly are u placing the LIB files they should be in the CE folder bcos i too faced similar problems of un resolved external symbols


  • phpcs

    Good advice, Bryan. Jaqq, just to be sure: you are linking the library containing the function referenced in the third party library correct The /verbose switch on the linker is very useful for diagnosing errors like this, although you should be prepared to wade through a fair amount of output.

    Jeff



  • conzero

    Does the unresolved symbol look like one you would expect, or is it some seemingly bizarre function

    To help diagnose what is going on, you could turn on progress information in the linker, in project properties:

    Configuration Properties->Linker->General->Show Progress

    This should help you to figure out which LIBs are being used and why they want the additional method.

    Often times, where I've hit similar issues, it has been because a release version of a LIB has been pulled in instead of the debug version I had expected, or vice-versa.


  • chaminda perera

    I double checked the Additional dependencies and I do have the library there. I tried using #pragma too but it doesn't help. The 2019 error is coming from a function used in the 3rd party library. No default libraries is not set to true. I tried setting it to true, get a lot more errors and the same 2019 is still there.

  • cristib

    Hmmm... I realize that you've probably checked this, but are you certain that you have the library in Additional Dependencies for all your configurations Have you tried using #pragma to pull the library in, just as a test to see if this library is really getting included Is the 2019 error coming from a function that you use in the 3rd party static library, or is it potentially the case that there's some other strange dependency you aren't aware of Are you linking with no default libraries set to true

    Thanks,

    Jeff



  • MFC DLL link error