Package fail:fatal error LNK1181

OutputLog:
MainFrameActions: Packaging (Windows (64-bit)): Project.Build: ********** BUILD COMMAND STARTED **********
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: F:\UE4\Epic Games\4.12\Engine\Binaries\DotNET\UnrealBuildTool.exe User Win64 Development -Project=D:\User\User.uproject D:\User\User.uproject -remoteini=“D:\User” -noxge -generatemanifest -NoHotReloadFromIDE
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 1.805s to run UnrealBuildTool.exe, ExitCode=0
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: F:\UE4\Epic Games\4.12\Engine\Binaries\DotNET\UnrealBuildTool.exe User Win64 Development -Project=D:\User\User.uproject D:\User\User.uproject -remoteini=“D:\User” -noxge -NoHotReloadFromIDE -ignorejunk
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Performing 1 actions (4 in parallel)
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: [1/1] Link User.exe
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: LINK : fatal error LNK1181: �޷��������ļ���HACD_64.lib��
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: D:\User\Binaries\Win64\User.exe
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Total build time: 6.07 seconds
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 6.441s to run UnrealBuildTool.exe, ExitCode=5
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.AutomationException: Command failed (Result:5): F:\UE4\Epic Games\4.12\Engine\Binaries\DotNET\UnrealBuildTool.exe User Win64 Development -Project=D:\User\User.uproject D:\User\User.uproject -remoteini=“D:\User” -noxge -NoHotReloadFr
omIDE -ignorejunk. See logfile for details: ‘UnrealBuildTool-2018.07.18-16.01.33.txt’
MainFrameActions: Packaging (Windows (64-bit)): 在 AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options, Dictionary2 EnvVars) MainFrameActions: Packaging (Windows (64-bit)): 在 AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName, Dictionary2 EnvVars)
MainFrameActions: Packaging (Windows (64-bit)): 在 AutomationTool.UE4Build.BuildWithUBT(String TargetName, UnrealTargetPlatform TargetPlatform, String Config, FileReference UprojectPath, Boolean ForceMonolithic, Boolean ForceNonUnity, Boolean ForceDebugInfo, Boolean ForceFlushMac, Boolean DisableXGE, String InAddArgs, Boolean ForceUnity, Dictionary2 E MainFrameActions: Packaging (Windows (64-bit)): nvVars) MainFrameActions: Packaging (Windows (64-bit)): 在 AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable1 InDeleteBuildProducts, Boolean InUpdateVersionFiles, Boolean InForceNoXGE, Boolean InUseParallelExecutor, Boolean InForceNonUnity, Boolean InForceUnity, Boolean InShowProgress, Dictionary2 PlatformEnvVars, Nullable1 InChangelistNumberOverride,
Dictionary2 InTargetToManifest) MainFrameActions: Packaging (Windows (64-bit)): 在 Project.Build(BuildCommand Command, ProjectParams Params, Int32 WorkingCL, ProjectBuildTargets TargetMask) MainFrameActions: Packaging (Windows (64-bit)): 在 BuildCookRun.DoBuildCookRun(ProjectParams Params) MainFrameActions: Packaging (Windows (64-bit)): 在 AutomationTool.BuildCommand.Execute() MainFrameActions: Packaging (Windows (64-bit)): 在 AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary1 Commands) MainFrameActions: Packaging (Windows (64-bit)): 在 AutomationTool.Automation.Process(String[] CommandLine) MainFrameActions: Packaging (Windows (64-bit)): 在 AutomationTool.Program.MainProc(Object Param) MainFrameActions: Packaging (Windows (64-bit)): 在 AutomationTool.InternalUtils.RunSingleInstance(Func2 Main, Object Param)
MainFrameActions: Packaging (Windows (64-bit)): 在 AutomationTool.Program.Main()
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: AutomationTool exiting with ExitCode=5 (5)
MainFrameActions: Packaging (Windows (64-bit)): Domain_ProcessExit
MainFrameActions: Packaging (Windows (64-bit)): copying UAT log files…
MainFrameActions: Packaging (Windows (64-bit)): BUILD FAILED
PackagingResults:Error: Error Unknown Error

The default c++ function is referenced in my UserGameMode.cpp,and if this is the cause of the packaging failure.

If you delete your Saved and Intermediate folders then rebuild your project, does this still happen?

The problem seems to be a reference to HACD_64.lib. That library shouldn’t be referenced for builds it might be getting added by an reference to editor-only modules. Make sure there are no editor dependencies listed in your *.Build.cs file in the PublicDependencyModuleNames. Also, open up your uproject file using a text editor and check if there is an entry named “AdditionalDependencies.” It’s possible there are editor module dependencies listed in there as well.