Yesterday I was working on a project using C++ for a device under Visual Studio ’05 and for some reason it stopped linking with the following error:
error LNK2019: unresolved external symbol __security_check_cookie referenced in function “int __cdecl RegisterAndActivate(void)” (?RegisterAndActivate@@YAHXZ)
No idea even what the error meant, so I messed with some settings, rolled back code – all the usual things to try to find it. Nothing. I decided to bag it for the night – maybe fresh eyes today would help.
I loaded the project again today. Same error. I removed the project from the solution, created a new one, and re-added my code. Same error. So I turned to my fellow coders to see if anyone else had seen this.
Jeff Abraham of Microsoft replied as follows:
My psychic powers tell me that you are building against PPC2003, and you aren’t linking against secchk.lib. Try adding that to the linker inputs line, and seeing if that fixes the issue. I’m not sure how you would have gotten into this state without changing anything, as any project targeting PPC/SP 03 should have these libraries by default.
Sure, enough, I added secchk.lib to the Additional Dependencies line under the Project’s Linker | Input section and it’s now building again. Why the error occured in the first place I’m not too concerned with – the release of Studio is only weeks away and I’ll be uninstalling soon, but Googling on this error turned up nothing helpful at all. Hopefully this blog entry will remedy that if someone else is looking.