Click here to Skip to main content
15,885,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

can any one suggest me to disable warning in projectlevel.

I am using visual stuido 6.0.
I tried this below code in many files, but not worked.
.

C++
#pragma warning( disable : 4786 )


visual studio 6.0 is keep on giving warning:c:\program files\microsoft visual studio\vc98\include\map(27) : warning C4786: bla bla bla.....
Posted
Updated 30-Nov-11 0:47am
v2
Comments
LaxmikantYadav 30-Nov-11 7:11am    
You have to include #pragma warning( disable : 4786 ) statement in every source file at the beganing.
G Haranadh 30-Nov-11 7:17am    
hmm... thanks, i included in stdafx.cpp first line. anyway stdafx.h is included in every file.. :)

you can do it using IDE itself.
Go to Project Settings->C/C++ tab->Select "General" from category combo. select lower Level from "warning Level" Combo
 
Share this answer
 
Comments
G Haranadh 30-Nov-11 7:15am    
thanks for quick reply. My intention is to resolve this issue in project level and i want other warnings should come in same way..
the solution i used is, i moved the "pragma disable warning" to first line of stdafx.cpp; means before including stdafx.h i added this warning disable statement.
and compiled that warning not came again; for project level. thanks for your response too. thanks.
Albert Holguin 30-Nov-11 14:17pm    
if you wanted to do this for the whole project, why didn't you just do it in the stdafx.h (pre-compiled header) in the first place anyway?
G Haranadh 30-Nov-11 23:40pm    
yes. thanks alot. i did the same. :)
I don't think it can be done using the IDE itself. The way we do it is to have a global include file Configure.h that contains stuff that has to be set/defined/declared for every source file. This include file also disables some warnings using pragmas.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900