Monday, June 03, 2013

WinCE: unresolved external symbol ___security_cookie

In case it helps anyone else, I was getting tons of linker errors such as these on a TREQ (x86) unit, in LIBCMT and also in my own code:
LIBCMT.lib(ehprolg3.obj) : error LNK2001: unresolved external symbol ___security_cookie
LIBCMT.lib(exsup4.obj) : error LNK2001: unresolved external symbol ___security_cookie
LIBCMT.lib(sehprolg4.obj) : error LNK2001: unresolved external symbol ___security_cookie
LIBCMT.lib(ehprolg3.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
LIBCMT.lib(exsup4.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
LIBCMT.lib(sehprolg4.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol _atexit
atls.lib(atlcommodule.obj) : error LNK2001: unresolved external symbol _atexit
It didn't make any sense because I had another project that linked fine, and I even changed the two projects until they were almost identical, and still: one project linked OK, the other gave dozens of linker errors.

The solution was: in project options under "General", change "Use of MFC" from "Use MFC in a Static Library" to "Use Standard Windows Libraries".

The working project was *actually using MFC* while the nonworking project was not. Somehow, linking to MFC without using it causes linker errors.

0 Comments:

Post a Comment

<< Home