Friday, November 02, 2007

Warning treated as error Digg del.icio.us Reddit Yahoo

Problem: warning treated as error - no 'object' file generated

error C2220: warning treated as error - no 'object' file generated
warning C4996: 'wcstombs' was declared deprecated
warning C4996: 'sprintf' was declared deprecated
warning C4996: 'mbstowcs' was declared deprecated
warning C4996: 'wcstombs' was declared deprecated
warning C4996: 'fopen' was declared deprecated
warning C4996: 'strncpy' was declared deprecated
warning C4996: 'strcat' was declared deprecated


Solution:
Paste below line on top of your cpp file [link]
#pragma warning ( disable : 4996 )

Story:-D
Today's holiday and i'm alone in company.
A quiet and cold night and my friends enjoy of party and i'm fighting with an obsolete COM base code for an important project.

2 comments:

amastaneh said...

Disable warning about debug info truncated.
#pragma warning( disable : 4786 )

amastaneh said...

Set Project Settings > Configuration Properties > C/C++ > General > Treat Warnings As Errors as No