locked
Visual Studio 2015 LNK2001 RRS feed

  • Question

  • Hi, 

    I am attempting to convert our projects from VS 2010 to VS 2015, I have opened the projects in VS 2015 which informed me it has made changes to the project. When attempting to build it completes the build steps however is unable to link, I get many LNK2001 errors for C++ functions such as memcpy and math functions. However when creating a new project it will build and link fine. I have already tried to if the linker is getting the correct files and not the 2010 equivalents by enabling linker output which seems to suggest that it is getting the correct version of the files.

    If anyone could shed any light on this it would be great.

    Thanks, Tom

    Tuesday, July 21, 2015 11:20 AM

Answers

  • I am attempting to convert our projects from VS 2010 to VS 2015, I have opened the projects in VS 2015 which informed me it has made changes to the project. When attempting to build it completes the build steps however is unable to link, I get many LNK2001 errors for C++ functions such as memcpy and math functions. However when creating a new project it will build and link fine.

    Note that memcpy is a C function, not C++ - it's from the C Run Time Library (RTL).

    Are all of the errors related to C RTL functions?

    If so, it's possible that the conversion process isn't making the necessary adjustments
    to the Linker directories properties to enable it to search the correct directory for
    the C RTL under VS 2015.

    Under VS 2010 the C RTL libs were in the same location as the C++ libs. Under VS 2015
    the C RTL has been moved to a different location. Read my last post about the
    Universal CRT in this thread:

    "Standard files "stddef.h", "string.h" missing in Visual studio 2015 RC."
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/0f580a73-6f11-4aa6-abbe-6bf1438734c2/standard-files-quotstddefhquot-quotstringhquot-missing-in-visual-studio-2015-rc?forum=vclanguage

    - Wayne

    P.S. - Note that "building" includes the link process. So if the link fails then the build
    has failed. You can't have a successful build if the link has errors.

    • Proposed as answer by May Wang - MSFT Wednesday, July 22, 2015 6:37 AM
    • Marked as answer by Shu 2017 Thursday, July 30, 2015 12:02 PM
    Tuesday, July 21, 2015 2:38 PM