I'm trying to build an application as tiny as possible, and in doing so I'm trying to avoid use of the CRT by using Win API calls instead of standard C/C++ calls. Unfortunately, I'm still getting a single linker error:
Error 2 error LNK2001: unresolved external symbol _memcpy
I don't call memcpy anywhere in my code, so I presume one of the Windows functions is calling it. Turning on intrinsic functions gives an unresolved symbol _memset, which I don't use either. From my understanding, both memcpy and memset should be included with intrinsic functions enabled. Since my code is too long to post, here are the Win API calls in my program:
- lstrcpy
- wsprintf
- CopyMemory - the error switches to _memset when I comment this out
- OpenFileMapping
- MapViewOfFile
- CreateFileMapping
My questions:
- Why aren't the intrinsic functions being included if I have /Oi declared?
- Do I need to declare memset and memcpy on my own?
- If so, how do I do so without Visual Studio complaining of redefinition of intrinsic functions?