How to resolve error C4996: ' fopen ' problem

Source: Internet
Author: User

We use CRT functions such as fopen in the program, there will be some warning message, very annoying, as follows:

Error C4996: ' fopen ': This function or variable could be unsafe. Consider using fopen_s instead. To disable deprecation, use _crt_secure_no_warnings. See online Help for Details.1>f:\program files (x86) \microsoft Visual Studio 12.0\vc\include\stdio.h (211): Refer to "fopen" Statement <span style= "font-family: ' Microsoft Yahei '; White-space:pre-wrap; Background-color:rgb (255, 255, 255); " >:</span>


CRT functions (c Runtime Library = C Run-time libraries) are the extensions of Microsoft's C + + language. CRT functions are standard C-language functions. For example, functions such as printf, scanf, strlen, fopen, and so on, belong to CRT functions:

The quick solution is to include _crt_secure_no_warnings in the precompiled header, as follows:



And then the compilation was successful.

How to resolve error C4996: ' fopen ' problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.