lua51.lib(lua51.dll) : 错误 LNK2005: _vsnprintf 已经在 libcurl_a.lib(cryptlib.obj) 中定义
GameName.Build.cs ->
// Fill out your copyright notice in the Description page of Project Settings.
using System.IO;
using UnrealBuildTool;
public class GameName : ModuleRules
{
private string ThirdPartyPath
{
get { return Path.GetFullPath(Path.Combine(ModuleDirectory, "../../ThirdParty/")); }
}
private bool LoadLua()
{
bool isLibSupported = false;
string LibrariesPath = Path.Combine(ThirdPartyPath, "Lua", "libraries");
PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "lua51.lib"));
PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "Lua", "includes"));
Definitions.Add(string.Format("WITH_LUA_BINDING={0}", isLibSupported ? 1 : 0));
return true;
}
public GameName(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] { });
LoadLua();
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
// Uncomment if you are using online features
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
}
}
ActorName.cpp ->
// Fill out your copyright notice in the Description page of Project Settings.
#include "ActorName.h"
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#include "luaconf.h"
#pragma comment(lib, "lua51.lib")
}
// Sets default values
APart::APart()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void APart::BeginPlay()
{
Super::BeginPlay();
lua_State *L = luaL_newstate();
luaL_openlibs(L);
FVector NewLocation = GetActorLocation();
NewLocation.Z = NewLocation.Z + 200.0f;
}
// Called every frame
void APart::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
/*FVector NewLocation = GetActorLocation();
float DeltaHeight = (FMath::Sin(RunningTime + DeltaTime) - FMath::Sin(RunningTime));
NewLocation.Z += DeltaHeight * 100.0f;
NewLocation.Y += DeltaHeight * 800.0f;//Scale our height by a factor of 20
RunningTime += DeltaTime;
SetActorLocation(NewLocation);*/
}
我为 64x 编译了 LuaJit,我不包括 32x 构建,我需要吗?我不打算为 32 位系统发布我的游戏,因为没有意义大声笑(除了 IOS,因为我很确定您必须上传 32 位和 64 位版本的应用程序:3)
我只包含过一次 Lua51.lib 吗?我做错了什么吗?