Click here to Skip to main content
12,999,010 members (47,301 online)
Rate this:
Please Sign up or sign in to vote.
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.

#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 30-Nov-11 0:46am
Updated 30-Nov-11 0:47am
Laxmikant_Yadav 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.. :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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
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. :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 30 Nov 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100