Unresolved characters after converting VS2012 Windows 8 Metro to VS2013 (on Windows 8.1)

I have a question that I cannot solve efficiently at the moment, as I am still not familiar with the development of Metro applications. So please bear with me :)

In short, I have a large, sophisticated VS2012 Metro, application-driven + native solution (currently built on Windows 8), in VS2013, focused on Windows 8.1.

I imported the solution into VS2013 (hosted on Windows 8.1) and run the conversion for it and all sub-projects. Compilation of files, but it is with the linker that we encounter problems. This is an example of linker errors that we get:

error LNK2019: unresolved external symbol __imp___beginthreadex referenced in function <blahblahblah> error LNK2019: unresolved external symbol __imp___mbsrchr referenced in function <blahblahblah> error LNK2019: unresolved external symbol _getenv referenced in function <blahblahblah> error LNK2019: unresolved external symbol __imp___beginthreadex referenced in function <blahblahblah> error LNK2019: unresolved external symbol __imp___endthreadex referenced in function <blahblahblah> error LNK2019: unresolved external symbol __imp___mbsrchr referenced in function <blahblahblah> error LNK2019: unresolved external symbol __imp___mbsnbicmp referenced in function <blahblahblah> error LNK2019: unresolved external symbol __imp___dupenv_s referenced in function <blahblahblah> 

The fact is that for each individual character that is "missing", we can see that the announcement is present in the MS Windows header files supplied with VS2013. Checking the links in each subproject shows that they reference the "core" Windows libraries.

Any ideas why this is happening? Thanks.

+6
source share
1 answer

we can see that the ad is present in the MS Windows header files shipped with VS2013. Checking the links in each subproject shows that they link to the "core" Windows libraries

It will be difficult to diagnose what went wrong with this little information, but it’s pretty clear that you are looking at a completely wrong angle for this problem. Invalid characters are not api functions for Windows, these are functions to support C execution. They are only used in a C ++ project, you are viewing .NET projects.

So, you need to focus on one project that generates these linker errors, this is a C ++ project. The linker command that issued the link to the .lib file that has these characters is fully automated, so little can go wrong. The very first thing to do is to force the rebuild to not use the obsolete .obj and .lib files left over from the previous build in VS2012. Right-click the project and select Restore.

And it’s worth looking at the .vcxproj file for this project using a text editor (for example, Notepad) and make sure that the conversion went right and made the right changes:

  • the ToolsVersion property should be changed from "4.0" to "12.0"
  • MinimumVisualStudioVersion property should be changed from 11.0 to 12.0
  • two new properties added: ApplicationType (Windows Store) and ApplicationTypeRevision (8.1)
  • each configuration PlatformToolset property must be changed from v110 to v120

In the Debug\projectname.tlog there is a log file called link.read.1.tlog containing diagnostics, it shows all the .lib files that the linker uses. It should contain the following line:

C: \ PROGRAM FILES (X86) \ MICROSOFT VISUAL STUDIO 12.0 \ VC \ LIB \ STORE \ VCCORLIBD.LIB

Which .lib file contains these characters.

+2
source

All Articles