Share via

ror LNK2001 unresolved external symbol __imp_DeleteObject

John Emmatty 0 Reputation points
2023-03-01T13:30:21.7133333+00:00

Hello,

I am getting the following error while building a dll with MFC statically linked. There is no much information about this function available. Can anyone please tell me know what library i have to include to get rid of this error?

Error LNK2001 unresolved external symbol __imp_DeleteObject

I am using Visual Studio 2019

Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.


1 answer

Sort by: Most helpful
  1. YujianYao-MSFT 4,296 Reputation points Microsoft External Staff
    2023-03-02T05:41:36.23+00:00

    Hi John Emmatty,

    According to this doc DeleteObject() needs to link Gdi32.lib and use winodws.h.

    If you use glfw3.lib, I think this issue is also worth your reference.

    Best regards,

    Elya


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.