We develop an SDK that is used both in Unreal games and other C++ games.
This SDK is currently targeted at UE4 and we are upgrading it to UE5.
I am running into a linking issue, as the SDK uses GoogleTest. When I compile our UE5 project with the SDK, I run into linker conflicts with gtest.lib and gmock.lib.
Is there a way to tell UE5 to not link with Google Test outside of compiling the engine ourselves? I know I could alter the Build.cs files to not use GoogleTest if I was compiling the engine myself but my team has asked me to figure out how to get this to work with a default implementation of Unreal Engine.
Any suggestions? Thanks.
[Attachment Removed]
Steps to Reproduce
Build issue. Cannot easily send reproduction however it could be possible privately if necessary.
[Attachment Removed]
Hi,
I answered your question on EDC (https://forums.unrealengine.com/t/is\-there\-a\-way\-to\-remove\-disable\-googletest/2690419/2\), but I didn’t know you were using the Launcher version. With the Launcher version, the engine is prebuilt and changing the GoogleTest.build.cs has no effect because the module is already built.
The only thing I can think of for your case would be to disable all the plugin that references GoogleTest. Here the list of plugin that I found using GoogleTest in UE 5.6
- DNACalib.uplugin
- GeneSplicer.uplugin
- RigLogic.uplugin
So the first thing would be to disable those plugin if you have them explicitly enabled. Second, we need to find if other plugins enabled them. DNACalib and GeneSplicer are probably not a problem, but RigLogic.uplugin is. It is references in by MetaHumanSDK.uplugin which is referenced by Bridge.uplugin and those plugins are enabled by default. If you are not using Bridge nor MetaHuman, disabling both plugins from your .uproject (snipped below) should remove the GoogleTest dependency since no enabled plugins will reference it anymore. I did that for Lyra I was able to get rid of RigLogic (and GoogleTest dependency).
{
"Name": "Bridge",
"Enabled": false
},
{
"Name": "MetaHumanSDK",
"Enabled": false
},
By the way, if you need to analyze module dependencies, UBT has a mode to do that. For example to analyze the build dependency of LyraGame on Win64, I used this command. It generates files (see the command log output) containing information.
.\RunUBT.bat LyraGame Win64 Development -mode=AnalyzeI’m going to log a JIRA to move the test out of the runtime, it’s bad that UE runtime code links google test.
Regards,
Patrick
[Attachment Removed]
FYI: I created Unreal Engine Issues and Bug Tracker (UE\-360865\). The report is going to be reviewed and if accepted, the link will appear live in the next 24h/48h
[Attachment Removed]
Welcome! I’m glad this did the trick!
[Attachment Removed]
Thanks Patrick, I didn’t look closely enough at the response in the public forum to realize it was from Epic. Sorry for the double question post--I was informed by my team that we had pro help access after I had made the original post.
Let me try your above steps and see if I can get things to work. Thanks!
[Attachment Removed]
Great, thank you.
Your suggestion on editing the .uproject to remove Bridge and MetaHuman worked--we are building properly on UE5 now.
Thank you so much!
[Attachment Removed]