0

Been working on this project in Visual Studio 2017 for a couple weeks, and suddenly since my last build I started getting hundreds of LNK2001 errors. The supposed unresolved symbols seem to be standard CRT and C++ stuff, for example memmove, _imp_CrtDbgReport, strlen, etc. I was doing some stuff in the config of my project so I'm betting I hovered over an option and accidentally scrolled or something, but I can't seem to see any obvious issue.

The project is still being generated with the MDd CRT, I'm not ignoring default libs. I have, however, started using a new 3rd party library, but again the supposed LNK2001 errors are for things like strlen and memcpy.

To be clear, the issue I'm facing is that the standard C and C++ library functions like strlen, memmove, etc. that I have been using the entire time (not explicitly) are suddenly showing up as unresolved external symbols.

  • @rsjaffe Hey, thanks for the link. I had a read and while it does help my understanding of the error, the specific issue I'm facing is that standard C and C++ functions are the ones that are unresolved, so any sort of linkage or declaration/definition errors on my part seems to be unlikely. –  Oct 02 '20 at 01:44
  • This is a common problem with high-level GUI environments, which hide the actual nuts and bolts, and all the complexity, behind pretty menus, buttons, and dialogs. As long as it works, it's ok. But when it breaks, it's pretty much impossible to figure out exactly what's broken. It takes longer to learn using traditional command-line tools, on Linux, writing a Makefile, putting together your compiler and link commands, etc... But you know exactly what's happening, every step of the way, and when something breaks you'll know exactly what's broken, and what needs to be done to fix it. – Sam Varshavchik Oct 02 '20 at 01:53
  • Actually, it does. Something like that can never happen in any of my Linux-based builds, like this particular library with 1729 C++ source and header files. If I started getting similarly weird link failures with the system libraries, I know exactly where to look for (the Makefile), which commands get executed where, and where all the link options come from (best of luck figuring this out with VS), and what needs to be fixed. And some of my build framework is quite weird (XSLT stylesheets running XML to robo-generate canned C++ boilerplate, that subsequently gets compiled). – Sam Varshavchik Oct 02 '20 at 02:46

1 Answers1

1

I found the issue. I was passing in a command line argument to set the entry point to be wWinMain rather than just setting the subsystem type of the application to Windows.

  • This did fix the issue that I was having, it would be good to understand why explicitly setting the entry point causes linking issues with stdlib functions. – Robert Jun 03 '21 at 12:18