Linkage problem

kaveh rahimi 61 Reputation points

Hi , I have read your answer about my problem and didn't understand it . you told that application type is wrong . I have a header file the visual studio makes two errors about linkage . I don't know which type of application must I use for a header file?
The errors are LNK2019 and LNK1120
Please help me

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.
2,882 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 71,606 Reputation points

    Add the matching .CPP for the .H or link with the .lib, with

    #pragma comment(lib, "your_library.lib")
    0 comments No comments

  2. YujianYao-MSFT 4,096 Reputation points Microsoft Vendor


    Reasons for LNK2019:

    An error occurred during the linking process. A common error is that you only include the header file but not the library file. You should check whether the file has been added correctly.

    Reasons for LNK1120:

    Only the declaration of the function, not the realization of the function, so the link can only be unsuccessful by compiling.

    You could refer to this document to add your own dynamic library.

    Best Regards,


    If the response is helpful, please click "Accept Answer" and upvote it.

    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.