Cute
Cute

Reputation: 14011

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.

Upvotes: 5

Views: 20407

Answers (4)

Akaanthan Ccoder
Akaanthan Ccoder

Reputation: 2179

#pragma warning(disable : 4146)

Set this at the file level instead of changing the project setting.

Upvotes: 1

sparco
sparco

Reputation: 85

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++) {

Upvotes: 1

sean e
sean e

Reputation: 11925

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.

Upvotes: 2

Sacx
Sacx

Reputation: 6392

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

Regards

Upvotes: 1

Related Questions