LINK : fatal error LNK1181: cannot load input file 'HACD_64.lib'

Hello,

I’m trying to package my app without success. I get the "UnrealBuildTool: LINK : fatal error LNK1181: cannot load file ‘HACD_64.lib’
I found lots of answers about this on the forum but nothing is working in my case.

For you to know, I use a third party library in my project, “Kinect20”. I added the library in my project folder, and adapted my build.cs to load it (see below). Plus, in visual studio, “Debog” → “UE4 properties” → “VC++ Directory” I added the path to kinect20 Includes and Libraries.
The kinect is working in the editor, I don’t think it comes from that but… mhhee…

The logs:

MainFrameActions: Packaging (Windows (64-bit)): Running AutomationTool...
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: 2016-06-03T14:28:28.7963353Z: Running on WindowsHostPlatform as a 64-bit process.
MainFrameActions: Packaging (Windows (64-bit)): Automation.ParseCommandLine: Parsing command line: -ScriptsForProject=C:/Users/balthazar/Desktop/Phobia/Phobia.uproject BuildCookRun -nocompile -nocompileeditor -installed -nop4 -project=C:/Users/balthazar/Desktop/Phobia/Phobia.uproject -cook -stage -archive -archivedirectory=C:/Users/balthazar -package -client
config=Development -ue4exe=UE4Editor-Cmd.exe -pak -prereqs -nodebuginfo -targetplatform=Win64 -build -CrashReporter -utf8output
MainFrameActions: Packaging (Windows (64-bit)): Automation.Process: Setting up command environment.
MainFrameActions: Packaging (Windows (64-bit)): Automation.Process: Compiling scripts.
MainFrameActions: Packaging (Windows (64-bit)): BuildCookRun.SetupParams: Setting up ProjectParams for C:\Users\balthazar\Desktop\Phobia\Phobia.uproject
MainFrameActions: Packaging (Windows (64-bit)): Project.Build: ********** BUILD COMMAND STARTED **********
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: C:\Program Files (x86)\Epic Games\4.11\Engine\Binaries\DotNET\UnrealBuildTool.exe Phobia Win64 Development -Project=C:\Users\balthazar\Desktop\Phobia\Phobia.uproject  C:\Users\balthazar\Desktop\Phobia\Phobia.uproject  -remoteini="C:\
MainFrameActions: Packaging (Windows (64-bit)): Users\balthazar\Desktop\Phobia" -noxge -generatemanifest -NoHotReloadFromIDE
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 1.4213214s to run UnrealBuildTool.exe, ExitCode=0
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: C:\Program Files (x86)\Epic Games\4.11\Engine\Binaries\DotNET\UnrealBuildTool.exe Phobia Win64 Development -Project=C:\Users\balthazar\Desktop\Phobia\Phobia.uproject  C:\Users\balthazar\Desktop\Phobia\Phobia.uproject  -remoteini="C:\Users\balthazar\Desktop\Phobia" -noxge -NoHotReloadFromI
DE -ignorejunk
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Performing 1 actions (4 in parallel)
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: [1/1] Link Phobia.exe
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: LINK : fatal error LNK1181: impossible d'ouvrir le fichier en entr�e 'HACD_64.lib'
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: C:\Users\balthazar\Desktop\Phobia\Binaries\Win64\Phobia.exe
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Total build time: 3.69 seconds
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 3.8471473s to run UnrealBuildTool.exe, ExitCode=5
MainFrameActions: Packaging (Windows (64-bit)): Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.AutomationException: Command failed (Result:5): C:\Program Files (x86)\Epic Games\4.11\Engine\Binaries\DotNET\UnrealBuildTool.exe Phobia Win64 Development -Project=C:\Users\balthazar\Desktop\Phobia\Phobia.uproject  C:\Users\balthazar\
Desktop\Phobia\Phobia.uproject  -remoteini="C:\Users\balthazar\Desktop\Phobia" -noxge -NoHotReloadFromIDE -ignorejunk. See logfile for details: 'UnrealBuildTool-2016.06.03-16.28.31.txt' 
MainFrameActions: Packaging (Windows (64-bit)):    à AutomationTool.CommandUtils.RunAndLog(String App, String CommandLine, String Logfile, Int32 MaxSuccessCode, String Input, ERunOptions Options, Dictionary`2 EnvVars)
MainFrameActions: Packaging (Windows (64-bit)):    à AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName, Dictionary`2 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, Dictionary`2 EnvVa
rs)
MainFrameActions: Packaging (Windows (64-bit)):    à AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable`1 InDeleteBuildProducts, Boolean InUpdateVersionFiles, Boolean InForceNoXGE, Boolean InUseParallelExecutor, Boolean InForceNonUnity, Boolean InForceUnity, Boolean InShowProgress, Dictionary`2 PlatformEnvVars)
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(List`1 CommandsToExecute, CaselessDictionary`1 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(Func`2 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

My build.cs

// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;
using System.IO;

public class Phobia : ModuleRules
{
	public Phobia(TargetInfo Target)
	{
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

		PrivateDependencyModuleNames.AddRange(new string[] { "UnrealEd", "AnimGraph", "BlueprintGraph" });

		// Uncomment if you are using Slate UI
		// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
		// PrivateDependencyModuleNames.Add("OnlineSubsystem");
		// if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
		// {
		//		if (UEBuildConfiguration.bCompileSteamOSS == true)
		//		{
		//			DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
		//		}
		// }
		LoadKinect20(Target);
	}
	
	public bool LoadKinect20(TargetInfo Target)
	{
		bool isLibrarySupported = false;
 
        if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
        {
            isLibrarySupported = true;
 
            string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "x64" : "x86";
            string LibrariesPath = Path.Combine(ThirdPartyPath, "Kinect20", "Libraries");
 
            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "Kinect20." + PlatformString + ".lib")); 
        }
 
        if (isLibrarySupported)
        {
            // Include path
            PublicIncludePaths.Add( Path.Combine( ThirdPartyPath, "Kinect20", "Includes" ) );
        }
 
        Definitions.Add(string.Format( "WITH_KINECT_BINDING={0}", isLibrarySupported ? 1 : 0 ) );
 
        return isLibrarySupported;
	}
	
	private string ModulePath
    {
        get { return Path.GetDirectoryName( RulesCompiler.GetModuleFilename( this.GetType().Name ) ); }
    }
	
	private string ThirdPartyPath
	{
		get { return Path.GetFullPath( Path.Combine( ModulePath, "../../ThirdParty/" ) ); }
	}
}

And the arborescence in my folder’s project:

|
|usual UE4 files
|ThirdParty|
---------------|Kinect20|
---------------------------|Includes
---------------------------|Libraries|
---------------------------------------|x64
---------------------------------------|x86
---------------------------|vgbtechs

Hello,

I performed a Google search for your error message, and came across a few results:

Take a look at these threads and let me know if any of these solutions work for you.

Have a great day

Hello Sean,

Sorry for the long time, I had to work on something else for a while.

So, about my issu, I did try to remove all references to “UnrealEd” in my build.cs and .ue_project but it didn’t fix it.
I tried to: Close UE and VS. Generate Visual studio files. Add again paths to libraries and includes for my Kinect20 module in the UE4 propertiy pages - VC++ Directories.

It didn’t work.

I did try to run UE4 as admin (did it by going somewhere like: program files/epic/4.11/binary → run as admin)
But it didn’t work.

I didn’t find anything else on google about that. I don’t know what to do, my project is to big to be transfert file by file in a new and clean project (and I don’t see why it would change anything).

I keep looking around, hoping.

Have a good day.
Dex

A couple of questions:

  • Are you using a source version of the editor or a binary version? Which version of 4.11 are you using, exactly? 4.11.2?
  • Are you able to package a clean, blank project successfully?
  • Have you tried running it without the Kinect20 module implemented? It could be related to this, but I’m not too familiar with that particular module so I may be wrong.

Hello and thank you for your time.

  • Binary (from Epic launcher) 4.11.2.
  • Yes, I’m able to package a clean project. I tested this with blueprint and c++ project, all ok.
  • I commented “LoadKinect20(Target);” in my build.cs and I deleted all class and blueprint using nodes related to my kinect implementation, but I have an “impossible to find kinect.h” during packaging. Kinect.h is provided by “kinect20” module, I don’t know why it is still looking for it as there shouldn’t be any class using it.

I’m currently installing 4.12.2, I’ll try to package with it, will see.

Ciao,
Dex

EDIT: Still not working with UE 4.12.2

Could you clarify exactly what the Kinect20 module is? I’m not too familiar with this module, myself.

Ok just to get back to you on this.
The kinect20 was code using SDK provided by Microsoft for this…
So in my UE visual studio project I have a class that use includes provided by microsoft, I guess the issu comes from somewhere here.

Anyway, I finely decided to use LeapMotion, not kinect. So no problem anymore.

thank you for your time,
Dex