1

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);*/
}

LuaJit を 64x 用にコンパイルしましたが、32x ビルドは含めていません。必要ですか? 意味がないので、32ビットシステム用にゲームをリリースするつもりはありません笑(IOS以外では、アプリの32ビットバージョンと64ビットバージョンをアップロードする必要があると確信しているため:3)

Lua51.lib を一度だけ含めたことがありますか? 私は何か間違ったことをした?

4

1 に答える 1