Two ways to set # define _crt_secure_no_warnings in VS

Source: Internet
Author: User

1. We are compiling old C-language open source projects such as the LUA source package, perhaps because some of the old. c files use unsafe functions such as strcpy,scanf, and report warnings and errors, resulting in the inability to compile through.

2. We have two solutions at this time:

A. Defined at the beginning of the specified source file: #define _crt_secure_no_warnings (only works in this file)

B. Set in the project properties, which will take effect throughout the project, select: Properties---config properties-----preprocessor-----edit

Add one line to the bottom: _crt_secure_no_warnings (Note that no # define is required)

As shown in the following:

Two ways to set # define _crt_secure_no_warnings in VS

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.