Cannot find HCAD.lib when using UnrealED

I need to use the FileHelpers.h in UnrealEd, But if I add UnrealEd in PublicDependencyModuleNames.

When I try to package my project, I will get this error:

I think it’s tries to tell me that it cannot found HCAD.lib, My compiler always shows these question markers with errors, It probably has to do something with my language setting.

I ve seen other people posting the same question, but the solution to theirs is to remove UnrealEd from PublicDependencyModuleNames. The things is, I need the FileHelpers.h in the UnrealEd. I’ll be greatly appreciated if anyone can help me out on this.

Hello,

The things contained in UnrealEd are only available to be used inside of the editor so it fails whenever you attempt to package. The only way for you to include this without heavily editing the source code (I’m not even sure how much that would entail, but it would be a lot) would be to let the editor know that you only want to include it for use inside of the editor. You can do that by using the syntax given by ZKarmaKun near the end of this forum thread: Halp! Cannot open input file 'HACD_64.lib' when packaging - C++ - Epic Developer Community Forums

Thanks for the help, I added those line in my Wind_Farm_X.Build.cs files

But I am getting the error of not finding FileHelpers.h, like I didn’t include UnrealEd at all.

I am not sure if I added those lines in the right place, Did I do anything wrong? Thanks again.

The error message seems to be pointing to line #5 in a particular .cpp file. I can’t tell what it is due to where the screenshot cuts off. Could you take a look at that file and see why that line would be causing the compilation to fail? It seems like it may be referencing a file that doesn’t exist.

Here is the full screenshot

And below is my .cpp file, please note that MySQLConnecter doesn’t actually do anything with MySQL, I was planning to use MySQL but finally give up and decided to read a text file instead, so I used FileHelpers.h in the UnrealED.

So, any ideas?

I’m not sure if this will work due to not knowing what you’re using FileHelpers.h for exactly, but can you try surrounding the include for it with an #if WITH_EDITOR, like so?

#if WITH_EDITOR
#include "FileHelpers.h"
#endif

This should let it be used in the editor but be excluded from the end product, since it’s part of UnrealEd and won’t be visible at that point since UnrealEd isn’t either.

Many thanks to you, it worked!

I think I need to say, tyvm for this post took me a long time to find it and fix my issue so my build could get done, 6hrs later to get a shipping build pushed to steam, normally 30 mins. To help Mr Google out, IWYU, PCH, EditorStyle. Thanks again, think I need to invest into a build system so I don’t do this to myself again.