1、ue4源码链接第三方库

1、首先创建一个用于放置第三方库的文件夹,这里创建的是CLE文件夹,里面对应创建相应的文件夹和文件

 

 2、把对方给的第三方库文件放到相应的目录下

 

 

 

 

 .注意:build.cs是直接通过右键新建一个 .txt文件,然后直接修改文件名即可

2、编写, .build.cs  

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.

using System;
using System.IO;
using UnrealBuildTool;
using System.Runtime.InteropServices;

public class CLE : ModuleRules
{
    public CLE(ReadOnlyTargetRules Target) : base(Target)
	{
		Type = ModuleType.External;
        bUseRTTI = true;

        string SdkBase = ModuleDirectory;

        if (!Directory.Exists(SdkBase))
        {
            string Err = string.Format("CLE SDK not found in {0}", SdkBase);
            System.Console.WriteLine(Err);
            throw new BuildException(Err);
        }

        PublicIncludePaths.Add(SdkBase + "/Includes");
		string LibraryPath = SdkBase + "/Lib/";
        string DllPath = SdkBase + "/Dll/";
        
        string sourceFile = Path.Combine(ModuleDirectory, "Dll/CLESDK.dll");
        RuntimeDependencies.Add(sourceFile);

        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            PrivateRuntimeLibraryPaths.Add(DllPath);

            PublicAdditionalLibraries.Add("$(ModuleDir)/Lib/VS2019/X64/CLESDK.lib");
            PublicAdditionalLibraries.Add("$(ModuleDir)/Lib/VS2019/X64/CLESDKD.lib");
            PublicDelayLoadDLLs.Add("CLESDK.dll");
        }
    }
}

3、重新setup和GenerateProjectFiles.bat,然后运行 .sln    

 4、在需要用的模块中添加相应的文件

注:在创建新的  .h  和  .cpp文件时,可以直接在文件夹里面复制贴贴,重命名,然后setup和generate

 5、重新setup和GenerateProjectFiles.bat,然后运行 .sln   

6、在使用的时候添加头文件就可以

 7、一般情况还需要初始sdk,还有license

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值