none
LNK2019 "Unable to add a project-to-project reference"

    Question

  • I have several VS projects that I need to build. It may be worth noting that the last time these projects were built was with VS2008 and now I'm required to use VS2015. I've noticed the msdn link on error code LNK2019 points out a possible cause of this error that I believe is related to my case. Its described as 

    "A build dependency is only defined as a project dependency in the solution. In earlier versions of Visual Studio, this level of dependency was sufficient. However, starting with Visual Studio 2010, Visual Studio requires a project to project reference. If your project does not have a project-to-project reference, you may receive this linker error. Add a project-to-project reference to fix it."

    There are a total of "5" projects i'm building. I've been able to build three successfully but the last two keep complaining about external symbols with error code "LNK2019". In fact the majority of these "LNK2019" errors that show up all point to one file called xxxxxAPI.lib (si_api.obj). I've tried following the instructions in adding a project to project reference from here <https://msdn.microsoft.com/en-us/library/f3st0d45.aspx>. However when I go into "Add Reference" i'm greeted with a black dialog box giving me no options in projects to add.

    I'm sure this is a lack of understanding on my part and would appreciate any feedback. If you would be so kind in being detailed on your answer that would be great as I'm not a VS guru.

    Thanks

    ~S

    Tuesday, January 03, 2017 8:35 PM

All replies

  • Hi regnar86,

    >> However when I go into "Add Reference" i'm greeted with a black dialog box giving me no options in projects to add.

    According to your description, your project is upgrade from VS2008 to VS2015. I suggest you create a new blank solution with the same name and then add the original projects into the new solution by Add -> Existing Project. This could help us check whether there has any problem when upgrade the project.

    In addition, please create a new solution with multiple projects and try add project reference with the same steps. If it also has the same problem, this issue should be related to your Visual Studio itself. Please try with following steps to troubleshooting this issue.

    1. Make sure your Visual Studio 2015 has installed the latest update.
    2. Run Visual Studio as administrator to make sure it has enough permission to do any operations.
    3. Run Visual Studio in safe mode to check whether this issue related to VS packages.

    >> In fact the majority of these "LNK2019" errors that show up all point to one file called xxxxxAPI.lib (si_api.obj).

    Please check whether the xxxxAPI.lib file stored in the linked directory first. And there are other possible reasons listed in the document that you provided, please check whether the issue for xxxAPI.lib issue is not caused by "A build dependency is only defined as a project dependency in the solution".

    Best Regards,
    Weiwei


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, January 04, 2017 7:29 AM
    Moderator