Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve the following C2220 error?

I am getting the following error while building a project. Even though I am setting the property "treat warning as errors" to "NO" I am getting this one:

error C2220: warning treated as error - no object file is created.

Can any one Help me Resolving This One? Thanks in Advance.

like image 582
Cute Avatar asked Jun 01 '09 07:06

Cute


3 Answers

The documentation for C2220 suggests compiling at a lower warning level. It also shows that the warning treated as error option is implemented as a compiler flag: /WX. So you could search your .vcproj file for that text and manually remove it from the file.

like image 200
sean e Avatar answered Nov 05 '22 13:11

sean e


Probably you forgot to add an header. Just where you get the first warning and see in what header file is defined.

Regards

like image 1
Sacx Avatar answered Nov 05 '22 13:11

Sacx


I got "error C2220: warning treated as error - no object file is created." in below code.
Once I changed datatype of total to int , the error was resolved.

int colNum=0;
unsigned int total=123;
for (colNum=0;colNum<total;colNum++) {
like image 1
sparco Avatar answered Nov 05 '22 13:11

sparco