diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index b91c614424365c16f44ea5dc7cbf8c03cae6ea39..ae25aec2065d37aa648d01bbde60453f213fdc02 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -56,6 +56,10 @@
 
 static LLDefaultChildRegistry::Register<LLButton> r("button");
 
+// Compiler optimization, generate extern template
+template class LLButton* LLView::getChild<class LLButton>(
+	const std::string& name, BOOL recurse) const;
+
 // globals loaded from settings.xml
 S32	LLBUTTON_H_PAD	= 0;
 S32	LLBUTTON_V_PAD	= 0;
diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp
index 7f0f9751dbbe0a9c2c15a7d09801af12d582fd2d..33630dbb5e1d779c0611b9c83631129e6bdba32e 100644
--- a/indra/llui/llcheckboxctrl.cpp
+++ b/indra/llui/llcheckboxctrl.cpp
@@ -50,6 +50,10 @@ const U32 MAX_STRING_LENGTH = 10;
 
 static LLDefaultChildRegistry::Register<LLCheckBoxCtrl> r("check_box");
 
+// Compiler optimization, generate extern template
+template class LLCheckBoxCtrl* LLView::getChild<class LLCheckBoxCtrl>(
+	const std::string& name, BOOL recurse) const;
+
 LLCheckBoxCtrl::Params::Params()
 :	text_enabled_color("text_enabled_color"),
 	text_disabled_color("text_disabled_color"),
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 4ea30dbd4d42aeedc51ab2891cf27c0d82e16744..cade6e45e135c2bfe213bd2330450769a536f4b3 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -71,6 +71,10 @@ const F32	TRIPLE_CLICK_INTERVAL = 0.3f;	// delay between double and triple click
 
 static LLDefaultChildRegistry::Register<LLLineEditor> r1("line_editor");
 
+// Compiler optimization, generate extern template
+template class LLLineEditor* LLView::getChild<class LLLineEditor>(
+	const std::string& name, BOOL recurse) const;
+
 //
 // Member functions
 //
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 063822dd567ce25064300d76754de622fa043a95..3a6c55ba0e1413d7521dfa17e3f6e879950c433d 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -58,6 +58,10 @@
 
 static LLDefaultChildRegistry::Register<LLPanel> r1("panel", &LLPanel::fromXML);
 
+// Compiler optimization, generate extern template
+template class LLPanel* LLView::getChild<class LLPanel>(
+	const std::string& name, BOOL recurse) const;
+
 LLPanel::LocalizedString::LocalizedString()
 :	name("name"),
 	value("value")
diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp
index 4c4123cf45213f7a805587e23fca5df9c580c12b..c0edccd0f3ad6d41c235b9d4363fa2f72b631d11 100644
--- a/indra/llui/lltextbox.cpp
+++ b/indra/llui/lltextbox.cpp
@@ -40,6 +40,10 @@
 
 static LLDefaultChildRegistry::Register<LLTextBox> r("text");
 
+// Compiler optimization, generate extern template
+template class LLTextBox* LLView::getChild<class LLTextBox>(
+	const std::string& name, BOOL recurse) const;
+
 LLTextBox::LLTextBox(const LLTextBox::Params& p)
 :	LLTextBase(p),
 	mClickedCallback(NULL)
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 3f4ef24f82a85b82daaf61312fd0e13ad0d26347..2df7d12704f2d29162203567248bf4fda52f1103 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -73,6 +73,10 @@
 //
 static LLDefaultChildRegistry::Register<LLTextEditor> r("simple_text_editor");
 
+// Compiler optimization, generate extern template
+template class LLTextEditor* LLView::getChild<class LLTextEditor>(
+	const std::string& name, BOOL recurse) const;
+
 //
 // Constants
 //
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index a30d5b4651d30daeede064016bf8e3404df5905d..466f45942d227c31860c4b96536bdd93b43f207f 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -40,6 +40,10 @@
 
 static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl");
 
+// Compiler optimization, generate extern template
+template class LLUICtrl* LLView::getChild<class LLUICtrl>(
+	const std::string& name, BOOL recurse) const;
+
 LLUICtrl::Params::Params()
 :	tab_stop("tab_stop", true),
 	chrome("chrome", false),
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index dba24ee165fbb2a1aa19423c59b407f74fa8a97d..4fc52997a14310f3c536e8d6fdbbb854ddfd1c58 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -76,6 +76,9 @@ std::vector<LLViewDrawContext*> LLViewDrawContext::sDrawContextStack;
 BOOL LLView::sIsDrawing = FALSE;
 #endif
 
+// Compiler optimization, generate extern template
+template class LLView* LLView::getChild<class LLView>(const std::string& name, BOOL recurse) const;
+
 static LLDefaultChildRegistry::Register<LLView> r("view");
 
 LLView::Params::Params()
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 2607120e17cbd54ea9d1390694936849e3377625..5bf015362d2aee386d2643361aef217961c38223 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -659,4 +659,23 @@ template <class T> T* LLView::getChild(const std::string& name, BOOL recurse) co
 	return result;
 }
 
+// Compiler optimization - don't generate these specializations inline,
+// require explicit specialization.  See llbutton.cpp for an example.
+extern template class LLButton* LLView::getChild<class LLButton>(
+	const std::string& name, BOOL recurse) const;
+extern template class LLCheckBoxCtrl* LLView::getChild<class LLCheckBoxCtrl>(
+	const std::string& name, BOOL recurse) const;
+extern template class LLLineEditor* LLView::getChild<class LLLineEditor>(
+	const std::string& name, BOOL recurse) const;
+extern template class LLPanel* LLView::getChild<class LLPanel>(
+	const std::string& name, BOOL recurse) const;
+extern template class LLTextBox* LLView::getChild<class LLTextBox>(
+	const std::string& name, BOOL recurse) const;
+extern template class LLTextEditor* LLView::getChild<class LLTextEditor>(
+	const std::string& name, BOOL recurse) const;
+extern template class LLUICtrl* LLView::getChild<class LLUICtrl>(
+	const std::string& name, BOOL recurse) const;
+extern template class LLView* LLView::getChild<class LLView>(
+	const std::string& name, BOOL recurse) const;
+
 #endif //LL_LLVIEW_H