This article is a mirror article of machine translation, please click here to jump to the original article.

View: 17151|Reply: 2

[C] error C2220: Warning is considered an error - no "object" file was generated

[Copy link]
Posted on 4/14/2016 8:22:30 PM | | |

http://blog.csdn.net/cay22/article/details/5613625
The reason for this error is that the code page of the file is in English, while the code page in our system is Chinese.
Solution:
1. Start Microsoft Visual Studio 2005, File - > Open - > select the cpp and save. Running from a new open program file, this error no longer appears.
     If not, then 2

2. If the above cannot remove the error, you can also click on the project, right-click and select Properties->Configuration Properties->C/C++->General, and change the option of "Treat Warning as Error" to "No". That's fine!

The first method was ineffective, the second method worked but ignored the warning.
Later it turned out that the error was caused by comparing the int type with the size_t type.
vector<Foo> fooVec;
int index = 0;
..
for (index = 0; index < fooVec.size(); ++index)
{...}
Change the type of index to size_t.




Previous:I did a small experiment on how to understand that HTTP is a stateless protocol
Next:The VM VM that was just installed cannot be connected to the Internet
Posted on 5/26/2020 10:26:07 AM |
Dynamic avatar is a good dick
Posted on 12/15/2023 5:03:17 PM |
Prompt:Authors are banned or removed content is automatically blocked
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com