开发者

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

开发者 https://www.devze.com 2023-03-28 17:49 出处:网络
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 los

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

精彩评论

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