diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index a70d31431fe7fb32cb2d33b12740b9f0042cff03..a8094a5850d3123954cdf77cba300c83636c6d06 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -64,6 +64,9 @@
 #include "llmorphview.h"
 #include "llmoveview.h"
 #include "llparcel.h"
+#include "llquantize.h"
+#include "llrand.h"
+#include "llregionhandle.h"
 #include "llsdutil.h"
 #include "llselectmgr.h"
 #include "llsky.h"
@@ -71,6 +74,7 @@
 #include "llsmoothstep.h"
 #include "llsidetray.h"
 #include "llstatusbar.h"
+#include "llteleportflags.h"
 #include "llteleporthistory.h"
 #include "lltool.h"
 #include "lltoolcomp.h"
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 75033698b6cb7a687ad4a083ea13dad08b9ee9f8..3e3b52316935e07f6638aa688f92ccb1bf7be38c 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -33,14 +33,19 @@
 #ifndef LL_LLAPPVIEWER_H
 #define LL_LLAPPVIEWER_H
 
+#include "llallocator.h"
 #include "llcontrol.h"
+#include "llsys.h"			// for LLOSInfo
 
+class LLCommandLineParser;
+class LLFrameTimer;
+class LLPumpIO;
 class LLTextureCache;
-class LLWorkerThread;
 class LLTextureFetch;
+class LLTimer;
+class LLVFS;
 class LLWatchdogTimeout;
-class LLCommandLineParser;
-class LLAllocator;
+class LLWorkerThread;
 
 
 class LLAppViewer : public LLApp
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index 4cd9647603fcde5c7d321fb7d9e092c06fd37ee1..1379073bba69b48467848be53b3648bce8834971 100644
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -58,11 +58,13 @@
 #include "lltexlayer.h"
 
 // library includes
+#include "lldir.h"
 #include "lleconomy.h"
 #include "llfloaterreg.h"
 #include "llfocusmgr.h"
 #include "llscrolllistctrl.h"
 #include "llsdserialize.h"
+#include "llvfs.h"
 
 // When uploading multiple files, don't display any of them when uploading more than this number.
 static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5;
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index 807f2f035cf3a8784c85b127608b381ec9a278bf..3cd612673928f886b48bf0d90f8d6c28a02fdef5 100644
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -41,6 +41,8 @@
 #include "llmenugl.h"
 #include "lluictrlfactory.h"
 
+#include "llcachename.h"
+
 #define MENU_ITEM_VIEW_PROFILE 0
 #define MENU_ITEM_SEND_IM 1
 
diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h
index 4d50541d9a6da4ec74bcdb442f3b196f6a26af18..2e10dea834552ae435d6e1ed286c9b88827aeb9b 100644
--- a/indra/newview/llavatarpropertiesprocessor.h
+++ b/indra/newview/llavatarpropertiesprocessor.h
@@ -34,6 +34,8 @@
 #define LL_LLAVATARPROPERTIESPROCESSOR_H
 
 #include "lluuid.h"
+#include "llsingleton.h"
+#include "v3dmath.h"	// LLVector3d
 #include <map>
 
 /*
diff --git a/indra/newview/llcapabilitylistener.cpp b/indra/newview/llcapabilitylistener.cpp
index 3277da893039e6114899be3cbde7c6768762cc48..4134e9e0a4729a728628288ff3e64e74b6f53cf6 100644
--- a/indra/newview/llcapabilitylistener.cpp
+++ b/indra/newview/llcapabilitylistener.cpp
@@ -21,6 +21,7 @@
 // other Linden headers
 #include "stringize.h"
 #include "llcapabilityprovider.h"
+#include "message.h"
 
 class LLCapabilityListener::CapabilityMappers: public LLSingleton<LLCapabilityListener::CapabilityMappers>
 {
diff --git a/indra/newview/llcapabilitylistener.h b/indra/newview/llcapabilitylistener.h
index 061227e04d6056d678b10d68a601aeb4f7ede42e..ce16b7da5daa7be22354392c815d92f54f3b0209 100644
--- a/indra/newview/llcapabilitylistener.h
+++ b/indra/newview/llcapabilitylistener.h
@@ -17,6 +17,7 @@
 #include "llerror.h"                // LOG_CLASS()
 
 class LLCapabilityProvider;
+class LLMessageSystem;
 class LLSD;
 
 class LLCapabilityListener
diff --git a/indra/newview/llcaphttpsender.cpp b/indra/newview/llcaphttpsender.cpp
index 1127f43424fc5ec04190eec39fa31ebfe08142df..b44e1f11fac65dc2a056d6aadaf686406ded086b 100644
--- a/indra/newview/llcaphttpsender.cpp
+++ b/indra/newview/llcaphttpsender.cpp
@@ -32,9 +32,10 @@
 
 #include "llviewerprecompiledheaders.h"
 
-#include "linden_common.h"
 #include "llcaphttpsender.h"
 
+#include "llhost.h"
+
 LLCapHTTPSender::LLCapHTTPSender(const std::string& cap) :
 	mCap(cap)
 {
diff --git a/indra/newview/llcloud.cpp b/indra/newview/llcloud.cpp
index 0099817de478cdab3d9783348a93d8091cb0aed3..af6f4e3286f4e8723ab8cdaf4deca4454cab8d3d 100644
--- a/indra/newview/llcloud.cpp
+++ b/indra/newview/llcloud.cpp
@@ -37,6 +37,7 @@
 #include "v3math.h"
 #include "v4math.h"
 #include "llquaternion.h"
+#include "llrand.h"
 #include "v4color.h"
 
 #include "llwind.h"
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp
index 096777ddd47caa56943647acd4c08580f48a6b6e..9d3b92d93742a46992564236ee037b5f3a2dc82b 100644
--- a/indra/newview/llcompilequeue.cpp
+++ b/indra/newview/llcompilequeue.cpp
@@ -56,10 +56,12 @@
 #include "llviewerobject.h"
 #include "llviewerregion.h"
 #include "llresmgr.h"
+
 #include "llbutton.h"
 #include "lldir.h"
 #include "llfloaterchat.h"
 #include "llviewerstats.h"
+#include "llvfile.h"
 #include "lluictrlfactory.h"
 #include "lltrans.h"
 
diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h
index 5a20eaef9bb8955abd8991e5fee4f2e8c652d5d4..22e5a4819d79a46f5afd9abd0a9911f6e3d3577b 100644
--- a/indra/newview/lldynamictexture.h
+++ b/indra/newview/lldynamictexture.h
@@ -33,6 +33,7 @@
 #ifndef LL_LLDYNAMICTEXTURE_H
 #define LL_LLDYNAMICTEXTURE_H
 
+#include "llcamera.h"
 #include "llgl.h"
 #include "llcoord.h"
 #include "llimagegl.h"
diff --git a/indra/newview/lleventpoll.h b/indra/newview/lleventpoll.h
index 12e4b49d57c63ccd2a0fad59beb29af939d84a48..f2465a361e9f9a622b83de804238ee7c35132bcd 100644
--- a/indra/newview/lleventpoll.h
+++ b/indra/newview/lleventpoll.h
@@ -35,6 +35,9 @@
 
 #include "llhttpclient.h"
 
+class LLHost;
+
+
 class LLEventPoll
 	///< implements the viewer side of server-to-viewer pushed events.
 {
diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h
index 537bf0c6a444d10fa4f29e6fdff85b1fd4ef18cf..383963a41d8693b92c19a147c3dd57ea3a1730bb 100644
--- a/indra/newview/llfeaturemanager.h
+++ b/indra/newview/llfeaturemanager.h
@@ -35,6 +35,7 @@
 
 #include "stdtypes.h"
 
+#include "llsingleton.h"
 #include "llstring.h"
 #include <map>
 
diff --git a/indra/newview/llhudeffectpointat.h b/indra/newview/llhudeffectpointat.h
index 81db3da1c78188136ad6f3246236e92dce352645..278c69fe2bff6e71f5b066b00988c6e15ee7f017 100644
--- a/indra/newview/llhudeffectpointat.h
+++ b/indra/newview/llhudeffectpointat.h
@@ -33,6 +33,7 @@
 #ifndef LL_LLHUDEFFECTPOINTAT_H
 #define LL_LLHUDEFFECTPOINTAT_H
 
+#include "llframetimer.h"
 #include "llhudeffect.h"
 
 class LLViewerObject;
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 469f6ec21db06b73f4cf15bab7e79af8736df3d8..37dcd1593fe475e0504024ab798ab92c8ab13464 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -33,6 +33,7 @@
 #ifndef LL_LLIMVIEW_H
 #define LL_LLIMVIEW_H
 
+#include "lldarray.h"
 #include "llmodaldialog.h"
 #include "llinstantmessage.h"
 #include "lluuid.h"
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 2193552f4a4b9a41670f2f3bad05acaafd1120a5..77e604769e882709e19834b1e7fe734b9f06f44f 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -35,6 +35,8 @@
 
 #include "llassettype.h"
 #include "lldarray.h"
+#include "llframetimer.h"
+#include "llhttpclient.h"
 #include "lluuid.h"
 #include "llpermissionsflags.h"
 #include "llstring.h"
@@ -111,7 +113,7 @@ class LLInventoryModel
 	LLInventoryModel();
 	~LLInventoryModel();
 
-	class fetchInventoryResponder: public LLHTTPClient::Responder
+	class fetchInventoryResponder : public LLHTTPClient::Responder
 	{
 	public:
 		fetchInventoryResponder(const LLSD& request_sd) : mRequestSD(request_sd) {};
diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h
index 9615d00200854256e827d6e294ed03b355c6b0f0..b99dd395847de4c86326d6b8c0b0d1a6f53f1a30 100644
--- a/indra/newview/llviewercamera.h
+++ b/indra/newview/llviewercamera.h
@@ -34,8 +34,9 @@
 #define LL_LLVIEWERCAMERA_H
 
 #include "llcamera.h"
-#include "lltimer.h"
+#include "llsingleton.h"
 #include "llstat.h"
+#include "lltimer.h"
 #include "m4math.h"
 
 class LLCoordGL;
diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h
index 90a54e2b9cf3c830b80c5821fc3b19b8025d9f96..c15e5df675a717ccc06bf0c4477d6e553babdc21 100644
--- a/indra/newview/llviewermessage.h
+++ b/indra/newview/llviewermessage.h
@@ -34,6 +34,7 @@
 #define LL_LLVIEWERMESSAGE_H
 
 #include "llinstantmessage.h"
+#include "llpointer.h"
 #include "lltransactiontypes.h"
 #include "lluuid.h"
 #include "stdenums.h"
@@ -42,10 +43,11 @@
 // Forward declarations
 //
 class LLColor4;
-class LLViewerObject;
 class LLInventoryObject;
 class LLInventoryItem;
+class LLMeanCollisionData;
 class LLMessageSystem;
+class LLViewerObject;
 class LLViewerRegion;
 
 //
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 21a99c58d9e58debd3f8a1e77b16fb6bc50622d5..72c713f2a69c8ba266c91360f2c0939d2a4c9cf5 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -64,6 +64,7 @@ class LLWorld;
 class LLNameValue;
 class LLNetMap;
 class LLMessageSystem;
+class LLPartSysData;
 class LLPrimitive;
 class LLPipeline;
 class LLTextureEntry;
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index 0f906a4d7f9c125f494e42a7ada2aaf037c5cfbf..ace5c5038e7d39d16d32f0b137eaaf86dd3391f7 100644
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -39,11 +39,13 @@
 // common includes
 #include "llstat.h"
 #include "lldarrayptr.h"
+#include "llmap.h"			// *TODO: switch to std::map
 #include "llstring.h"
 
 // project includes
 #include "llviewerobject.h"
 
+class LLCamera;
 class LLNetMap;
 class LLDebugBeacon;
 
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 35f374a4c8f4d777948e76a52bbb7072b0b1e800..49d0900f2ace9f36b6f4d30bb204ed29faff3f9e 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -51,6 +51,7 @@
 #include "llweb.h"
 #include "llcapabilityprovider.h"
 #include "llcapabilitylistener.h"
+#include "m4math.h"					// LLMatrix4
 
 // Surface id's
 #define LAND  1
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 301c032b25453cbe110e14fb19ccf786ed054140..56a8e3cd11c87b53608ad3a99ba5801a415420e9 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -39,6 +39,7 @@
 #include <string>
 #include <vector>
 
+#include "imageids.h"			// IMG_INVISIBLE
 #include "llchat.h"
 #include "lldrawpoolalpha.h"
 #include "llviewerobject.h"
@@ -49,6 +50,7 @@
 #include "llvoavatardefines.h"
 #include "lltexglobalcolor.h"
 #include "lldriverparam.h"
+#include "material_codes.h"		// LL_MCODE_END
 
 extern const LLUUID ANIM_AGENT_BODY_NOISE;
 extern const LLUUID ANIM_AGENT_BREATHE_ROT;
diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h
index 1066ac73f13992f3e4c797a2589e81675d934443..8b3bbb68bb218ef1ff164199bbcc90f5dc101bc7 100644
--- a/indra/newview/llvoiceclient.h
+++ b/indra/newview/llvoiceclient.h
@@ -43,6 +43,7 @@ class LLVivoxProtocolParser;
 #include "llframetimer.h"
 #include "llviewerregion.h"
 #include "llcallingcard.h"   // for LLFriendObserver
+#include "m3math.h"			// LLMatrix3
 
 class LLVoiceClientParticipantObserver
 {
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index 155775510e17129c859b1b44b217df016ab3a6a5..f20e551671ba977317f39f108d3a5d6c330bb287 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -37,6 +37,8 @@
 #include "llviewerimage.h"
 #include "llframetimer.h"
 #include "llapr.h"
+#include "m3math.h"		// LLMatrix3
+#include "m4math.h"		// LLMatrix4
 #include <map>
 
 class LLViewerTextureAnim;
@@ -158,12 +160,14 @@ class LLVOVolume : public LLViewerObject
 	/*virtual*/ S32		setTEBumpmap(const U8 te, const U8 bump);
 	/*virtual*/ S32		setTEShiny(const U8 te, const U8 shiny);
 	/*virtual*/ S32		setTEFullbright(const U8 te, const U8 fullbright);
+	/*virtual*/ S32		setTEBumpShinyFullbright(const U8 te, const U8 bump);
 	/*virtual*/ S32		setTEMediaFlags(const U8 te, const U8 media_flags);
 	/*virtual*/ S32		setTEGlow(const U8 te, const F32 glow);
 	/*virtual*/ S32		setTEScale(const U8 te, const F32 s, const F32 t);
 	/*virtual*/ S32		setTEScaleS(const U8 te, const F32 s);
 	/*virtual*/ S32		setTEScaleT(const U8 te, const F32 t);
 	/*virtual*/ S32		setTETexGen(const U8 te, const U8 texgen);
+	/*virtual*/ S32		setTEMediaTexGen(const U8 te, const U8 media);
 	/*virtual*/ BOOL 	setMaterial(const U8 material);
 
 				void	setTexture(const S32 face);
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index c017e9b64f9fcfee289e74bc1709d0f54d4dc683..5358fce766491e384eadf49b862ae90f95950d1d 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -33,6 +33,7 @@
 #ifndef LL_PIPELINE_H
 #define LL_PIPELINE_H
 
+#include "llcamera.h"
 #include "llerror.h"
 #include "lldarrayptr.h"
 #include "lldqueueptr.h"