将要编译的第一行代码是什么? [英] What is the first line of code that will be compiled?

查看:24
本文介绍了将要编译的第一行代码是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢使用 #pragma VC++ 2010 中的库链接和警告抑制指令,而不是 Visual Studio 项目设置.原因是它们更显眼,而且即使 Visual Studio .suo 文件被破坏或破坏,这些信息也不会丢失.

I like to use #pragma directives for library linkage and warning suppression in VC++ 2010 instead of Visual Studio project settings. The reason is they are more visible, and that information is not lost if the Visual Studio .suo file is nuked or destroyed.

所以在一行中:

#pragma warning( disable: 4018;4482;4996;4800)

这应该禁用我忽略 atm 的警告(注意:请抑制关于抑制警告是一种不好的做法的警告),但它们显然不会生效,直到它们在编译过程中遇到..

That's supposed to disable the warnings I'm ignoring atm (note: please suppress warnings regarding the suppression of warnings being a bad practice), but they clearly won't take effect until they get encountered in the compilation process..

那么我应该将这些警告抑制器放在哪个文件中?哪个是第一个编译的文件?

So what file should I put these warnings suppressors in? Which is the first file to be compiled?

我把它放在带有 main() 的文件中,但这不起作用(除非你把它放在项目设置中,否则你仍然会看到警告)

I put it in the file with main() in it, but that didn't work (you still see the warnings unless you put it in Project settings)

推荐答案

stdafx.h

想到,如果你必须把它放在一个文件中.(只需确保包含它.)

comes to mind, if you have to put it in a file. (Just make sure you include it.)

否则,只需将其放在 C/C++ 项目设置中(在高级"中).

Otherwise, just put it in the C/C++ project settings (in "Advanced").

这篇关于将要编译的第一行代码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆