开发者

What is the first line of code that will be compiled?

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.

So in a line like:

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

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?

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.)

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜