Recently, when I changed the SDL code, I added a function with the return value of the bool type. An error is returned when the result is compiled. So I went to the Internet to find out how to disable bool, and found that the/noBool compilation option can be disabled, but this option was not available when I checked the SDL compilation option, I wonder if there are other methods? The final reason is that the SDL code is c and there is no bool type in the c language (of course, Some compilers will pre-define bool, but most of them do not have bool ). By looking at the SDL compilation options, I also found some useful compilation options.
/NoBool
- The/noBool compiler option has been removed. The compiler now allowsBoolIn the C ++ source code file, it only appears as a keyword (rather than an identifier.
- Long LongType available now_ Int64Typedef. For more information, see basic types. Note: It is not supported in CRTLong Long.
========================================================== ======================================
_ CRT_SECURE_NO_DEPRECATE
Developers who use VC 2005 may encounter such problems. When using the std namespace library function, the following warning is often prompted:
Warning C4996: strcpy was declared deprecated
This warning is reported because VC2005 considers that a group of functions in the CRT may cause security problems such as memory leakage, buffer overflow, and illegal access. These functions include strcpy and strcat.
Of course, if you insist on using functions of the old and unsecure versions, you can use the _ CRT_SECURE_NO_DEPRECATE flag to ignore these warning issues. You can add the _ CRT_SECURE_NO_DEPRECATE flag to the compilation option C/C ++ | Preprocessor Definitions.
========================================================== ======================================
WIN32_LEAN_AND_MEAN
VC_EXTRALEAN and WIN32_LEAN_AND_MEAN are used to exclude rarely used services from the Windows header. VC_EXTRALEAN project can only be used in MFC, but WIN32_LEAN_AND_MEAN can be used in any project. This will speed up compilation.
========================================================== ======================================
/GS
Helps protect local variables to avoid direct Buffer Overflow
========================================================== ======================================
Refer:
Http://www.cppblog.com/noflybird/archive/2009/02/27/75052.aspx
Http://dev.csdn.net/article/63/63390.shtm
Http://support.microsoft.com/kb/166474/zh-cn
Http://blog.chinaunix.net/u1/35421/showart_335266.html
Http://msdn.microsoft.com/zh-cn/library/aa983524 (VS.71). aspx