# Is there a way to remove/disable GoogleTest? 

**URL:** <https://forums.unrealengine.com/t/is-there-a-way-to-remove-disable-googletest/2690419>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, question\
**Created:** [January 7, 2026, 9:29pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-remove-disable-googletest/2690419 "2026-01-07T21:29:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZJamieHall](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZJamieHall](https://forums.unrealengine.com/u/ZJamieHall)\
**Post date:** [January 7, 2026, 9:29pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-remove-disable-googletest/2690419/1 "2026-01-07T21:29:24Z")

</div>

We have a game that includes a library that already has a version of Google Test in it.

We recently upgraded to UE5. I can get configurations including the Editor to build, but any of the standalone windows builds fail with a ton of gmock.lib linking errors like:

“bool testing::internal::g\_help\_flag” (?g\_help\_flag@internal@testing@@3\_NA) already defined in gmock.lib(gtest-all.obj)

Is there a way to build without the Unreal included google test libraries? Or does someone know why our editor build would work but our standalone windows build fails?

Thanks.

---

<div class="post-metadata">

**Author:** ![Patrick\_Laflamme](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/patrick_laflamme/32/1036111_2.png) [@Patrick\_Laflamme](https://forums.unrealengine.com/u/Patrick_Laflamme)\
**Post date:** [January 9, 2026, 5:10pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-remove-disable-googletest/2690419/2 "2026-01-09T17:10:44Z")

</div>

Hi,

Ideally, you would modify the library you are using to not include GoogleTest in release mode, if possible, and just link the release mode library with the UE game. That would be the ideal, but if you don’t have the source (nor build) that library (or maybe you want to run the test at runtime).

I think it should be possible to workaround the problem in UE, but with some modifications to the engine. You could start by temporary modifying the file _E:\UE\_5.7\Engine\Source\ThirdParty\GoogleTest\GoogleTest.Build.cs_ to not link gmock.lib and see what relies on it in the engine, but as far as I can see by searching ‘GoogleTest’ in UE and looking at the module dependencies, they are a couple of ‘Programs’ that need it and few runtime test modules. The programs should not impact you, they are standalone that should not link your lib. For the plugins containing runtime test modules using GTest, you could disable the test modules since you should not need them to run the game. For example, the _E:\UE\_5.7\Engine\Plugins\Animation\RigLogic\Source\RigLogicLibTest\RigLogicLibTest.Build.cs_  
adds a dependency on GoogleTest like this:

```auto
			PublicDependencyModuleNames.AddRange(
				new string[]
				{
					"Core",
					"GoogleTest"
				}
			);

```

but this module is a test module in the RigLogic plugin, so you could disable it in  
_e:\UE\_5.7\Engine\Plugins\Animation\RigLogic\RigLogic.uplugin_ by removing those lines in the file:

```auto
		{
			"Name": "RigLogicLibTest",
			"Type": "Runtime",
			"LoadingPhase": "PreDefault",
			"PlatformAllowList": [
				"Win64"
			]
		},

```

Something like that should work. The idea is to remove dependencies to GoogleTest module and if nothing references it, it should not be an issue anymore.

Regards,  
Patrick

---

<div class="post-metadata">

**Author:** ![ZJamieHall](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZJamieHall](https://forums.unrealengine.com/u/ZJamieHall)\
**Post date:** [January 12, 2026, 4:48pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-remove-disable-googletest/2690419/3 "2026-01-12T16:48:07Z")

</div>

Thanks for the suggestion–altering GoogleTest.Build.cs doesn’t seem to do anything for me.  
I tried commenting out the reference to gmock.lib in that file but it didn’t change anything.Even if I fill the file with gibberish, it doesn’t create any errors.
