虚幻引擎4.21.2和Squareys CISQLite3插件编译问题

Unreal Engine 4.21.2 & Squareys CISQLite3 Plugin Compile Issues

本文关键字:CISQLite3 Squareys 插件 编译 问题 引擎      更新时间:2023-10-16

我正在尝试将SQLite3集成到UE4中的测试项目中,但是我遇到了一些问题,没有很多问题。

首先是一些家政服务。 链接到GitHub上的存储库,其中Square具有插件,该插件是旧CISQLite3插件的分支和更新版本:

https://github.com/Squareys/unreal-sqlite3

接下来,我使用的项目是一个蓝图项目,其中包含从编辑器中创建的自定义类。

安装步骤: 我遵循了存储库自述文件中的安装指南,其中指出以下内容:

下载插件 zip 并将其解压缩到您的项目插件文件夹中。 打开编辑器并转到插件管理器并启用插件。 重新启动并允许编辑器编译插件。

在 4.20.x 中,这显然是所有需要的。 无论出于何种原因,在 4.21.2 中,此过程都被破坏了。 我遇到了与生成的文件相关的各种问题。

因此,对于我尝试过的: 我尝试为插件中间文件夹中生成的文件提供绝对路径 - 这只允许编译器像来自地狱的老忠实一样喷出错误。

我试过开始一个新的项目;三次。 我总是遇到一个我无法进一步的地步,因为我稍后会在帖子中放一个错误。

我尝试在删除 .vs、二进制文件、中间文件夹和保存文件夹后重新生成项目文件。 有时重建可以重新创建文件(不能解决问题),但在某些时候它开始失败,当我打开项目时,它将无法编译项目 dll/lib 并说手动编译。

好的,以此类推实际错误。 我将逐步引导您完成调试,并在我执行的每个调试步骤中显示错误。

因此,首先,即使在没有自定义代码的新项目中,我也会收到以下两个警告:

MiningTechDemo5\Plugins\CISQLite3\

Source\CISQLite3\CISQLite3.Build.cs: 警告:模块必须指定显式预编译标头(例如。PrivatePCHHeaderFile = "Private/CISQLite3PrivatePCH.h") 从 UE 4.21 开始。

MiningTechDemo5\Plugins\CISQLite3\Source\CISQLite3\CISQLite3.Build.cs: 警告:引用目录 'F:\UE4\Epic Games\UE_4.21\Engine\Source\CISQLite3\Public' 不存在。

为了解决这个问题,我将插件构建文件更改为:

// Copyright (c) 2015 Jussi Saarivirta 2016 conflict.industries MIT License (MIT)
using UnrealBuildTool;
public class CISQLite3 : ModuleRules
{
public CISQLite3(ReadOnlyTargetRules Target) : base(Target)
{
PublicIncludePaths.AddRange(
new string[] {
"F:/UE4/Projects/MiningTechDemo5/Plugins/CISQLite3/Source/CISQLite3/Public"
}
);
PrivateIncludePaths.AddRange(
new string[] {
"F:/UE4/Projects/MiningTechDemo5/Plugins/CISQLite3/Source/CISQLite3/Private"
}
);
PublicDependencyModuleNames.AddRange(
new string[] {
"Engine",
"Core",
"CoreUObject"
}
);
PrivateDependencyModuleNames.AddRange(
new string[] {}
);
DynamicallyLoadedModuleNames.AddRange(
new string[] {}
);
}
}

我必须使用绝对路径,因为出于某种原因,ModuleDirectory 只指向我的 F:\ 驱动器,而不是项目/插件文件夹。 所以,这些错误现在已经消失了。 一切似乎都很好,直到我将SQLiteDatabase.h包含在我的DatabaseHandler自定义类(在编辑器中创建)中。

我得到的第一个错误是找不到DatabaseHandler.generated.h,但这是因为找不到SQLiteDatabase.h的第二个错误。 所以我认为,也许这与 CISQLite3 构建文件的问题相同,我将我的项目构建文件从默认生成的代码更改为:

// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
public class MiningTechDemo5 : ModuleRules
{
public MiningTechDemo5(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] {  });
PrivateIncludePaths.Add("F:/UE4/Projects/MiningTechDemo5/Plugins/CISQLite3/Source/CISQLite3/Private");
PublicIncludePaths.Add("F:/UE4/Projects/MiningTechDemo5/Plugins/CISQLite3/Source/CISQLite3/Public");
PublicLibraryPaths.Add("F:/UE4/Projects/MiningTechDemo5/Binaries/Win64");
// 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
}
}

再一次,完整路径,因为 ModuleDirectory 不起作用,Path.Combine 也不起作用;至少不是字符串属性,这些字符串属性将部分路径作为帮助程序成员返回,因此键入的文本更少。

所以我重建,同样的错误。 我继续将包含更改为绝对路径:

包括 "SQLiteDatabase.h">

对此:

包括 "F:/UE4/Projects/MiningTechDemo5/Plugins/CISQLite3/Source/CISQLite3/Public/SQLiteDatabase.h">

重新 编译。 呵呵,没有错。 废话,因为现在有一个新的错误。 这个是针对SQLiteBlueprintNodes.h文件:

无法打开包含文件:"SQLiteBlueprintNodes.generated.h":没有这样的文件或目录

好的,所以我绝对把它变成这样:

包括"F:/UE4/Projects/MiningTechDemo5/Plugins/CISQLite3/Intermediate/Build/Win64/UE4Editor/Inc/CISQLite3/SQLiteBlueprintNodes.generated.h">

正是在这一点上,编译器获取生成的文件,并使用一堆编译器barf和SQLiteDatabaseStructs.generated.h的新生成文件未找到错误将其掏空:

'FSQLiteQueryLogicExpectedNode' uses undefined struct 'CISQLITE3_API'   8
'friend': not allowed outside of a class definition 9
type 'Z_Construct_UScriptStruct_FSQLiteQueryLogicExpectedNode_Statics' unexpected   9
missing type specifier - int assumed. Note: C++ does not support default-int    14
'FSQLiteQueryLogicExpectedNode': redefinition; previous definition was 'data variable'  14
missing type specifier - int assumed. Note: C++ does not support default-int    15
'FSQLiteQueryLogicExpectedNode': redefinition; previous definition was 'data variable'  15
'FSQLiteQueryLogicExpectedNode': constructor initializer lists are only allowed on constructor definitions  16
syntax error: '}'   19
syntax error: missing ';' before '}'    19
'FSQLiteQueryTermExpectedNode' uses undefined struct 'CISQLITE3_API'    23
'friend': not allowed outside of a class definition 24
type 'Z_Construct_UScriptStruct_FSQLiteQueryTermExpectedNode_Statics' unexpected    24
'FString Query': redefinition   27
'void __cdecl `dynamic initializer for 'Query''(void)': constructor initializer lists are only allowed on constructor definitions   27
missing type specifier - int assumed. Note: C++ does not support default-int    29
'FSQLiteQueryTermExpectedNode': redefinition; previous definition was 'data variable'   29
missing type specifier - int assumed. Note: C++ does not support default-int    30
'FSQLiteQueryTermExpectedNode': redefinition; previous definition was 'data variable'   30
'FSQLiteQueryTermExpectedNode': constructor initializer lists are only allowed on constructor definitions   31
syntax error: '}'   34
syntax error: missing ';' before '}'    34
'FSQLiteQueryFinalizedQuery' uses undefined struct 'CISQLITE3_API'  38
'friend': not allowed outside of a class definition 39
type 'Z_Construct_UScriptStruct_FSQLiteQueryFinalizedQuery_Statics' unexpected  39
'FString Query': redefinition   42
'void __cdecl `dynamic initializer for 'Query''(void)': constructor initializer lists are only allowed on constructor definitions   42
missing type specifier - int assumed. Note: C++ does not support default-int    44
'FSQLiteQueryFinalizedQuery': redefinition; previous definition was 'data variable' 44
missing type specifier - int assumed. Note: C++ does not support default-int    45
'FSQLiteQueryFinalizedQuery': redefinition; previous definition was 'data variable' 45
'FSQLiteQueryFinalizedQuery': constructor initializer lists are only allowed on constructor definitions 45
syntax error: '}'   46
syntax error: missing ';' before '}'    46
Cannot open include file: 'SQLiteDatabaseStructs.generated.h': No such file or directory    2

对于我绝对路径的每个生成的文件,我都会收到所有这些相同的错误,以及一个额外的生成文件错误,直到我回到SQLiteDatabase.h。 当我绝对路径生成的文件时,这是我得到的新错误:

预计在标题顶部包含:"#include"SQLiteDatabase.generated.h">

"

为简洁起见,我将包括上面提到的所有文件及其生成的文件,如果它们抛出错误,如下所示:

SQLiteBlueprintNotes.h:

#pragma once
#include "F:/UE4/Projects/MiningTechDemo5/Plugins/CISQLite3/Intermediate/Build/Win64/UE4Editor/Inc/CISQLite3/SQLiteBlueprintNodes.generated.h"

USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteQueryLogicExpectedNode
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Database Query")
FString Query;
FSQLiteQueryLogicExpectedNode(){}
FSQLiteQueryLogicExpectedNode(FString LHSQuery, FString Append) : Query(LHSQuery)
{
Query += Append;
}
};
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteQueryTermExpectedNode
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Database Query")
FString Query;
FSQLiteQueryTermExpectedNode(){}
FSQLiteQueryTermExpectedNode(FString LHSQuery, FString Append) : Query(LHSQuery)
{
Query += Append;
}
};
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteQueryFinalizedQuery
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Database Query")
FString Query;
FSQLiteQueryFinalizedQuery(){}
FSQLiteQueryFinalizedQuery(FString Query) : Query(Query){}
};

SQLiteBlueprintNodes.generated.h:

// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
===========================================================================*/
#include "UObject/ObjectMacros.h"
#include "UObject/ScriptMacros.h"
PRAGMA_DISABLE_DEPRECATION_WARNINGS
#ifdef CISQLITE3_SQLiteBlueprintNodes_generated_h
#error "SQLiteBlueprintNodes.generated.h already included, missing '#pragma once' in SQLiteBlueprintNodes.h"
#endif
#define CISQLITE3_SQLiteBlueprintNodes_generated_h
#define MiningTechDemo5_Plugins_CISQLite3_Source_CISQLite3_Public_SQLiteBlueprintNodes_h_39_GENERATED_BODY 
friend struct Z_Construct_UScriptStruct_FSQLiteQueryFinalizedQuery_Statics; 
static class UScriptStruct* StaticStruct();

#define MiningTechDemo5_Plugins_CISQLite3_Source_CISQLite3_Public_SQLiteBlueprintNodes_h_24_GENERATED_BODY 
friend struct Z_Construct_UScriptStruct_FSQLiteQueryTermExpectedNode_Statics; 
static class UScriptStruct* StaticStruct();

#define MiningTechDemo5_Plugins_CISQLite3_Source_CISQLite3_Public_SQLiteBlueprintNodes_h_9_GENERATED_BODY 
friend struct Z_Construct_UScriptStruct_FSQLiteQueryLogicExpectedNode_Statics; 
static class UScriptStruct* StaticStruct();

#undef CURRENT_FILE_ID
#define CURRENT_FILE_ID MiningTechDemo5_Plugins_CISQLite3_Source_CISQLite3_Public_SQLiteBlueprintNodes_h

PRAGMA_ENABLE_DEPRECATION_WARNINGS

SQLiteDatabaseStructs.h:

#pragma once
#include "F:/UE4/Projects/MiningTechDemo5/Plugins/CISQLite3/Intermediate/Build/Win64/UE4Editor/Inc/CISQLite3/SQLiteDatabaseStructs.generated.h"
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteIndex
{
GENERATED_USTRUCT_BODY()
/** String with piece if SQL script*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Index")
FString ResultStr = "";
/** Index name*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Index")
FString IndexName = "";
};
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLitePrimaryKey
{
GENERATED_USTRUCT_BODY()
/** String with piece if SQL script*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Primary Key")
FString ResultStr = "";
};
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteTableField
{
GENERATED_USTRUCT_BODY()
/** String with piece if SQL script*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Table Field")
FString ResultStr = "";
/** Field name*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Table Field")
FString FieldName = "";
/** Field type*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Table Field")
FString FieldType = "";
/** Field value*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Table Field")
FString FieldValue = "";
};
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteTableRowSimulator
{
GENERATED_USTRUCT_BODY()
/** Index name*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Index")
TArray<FSQLiteTableField> rowsOfFields;
};
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteTable
{
GENERATED_USTRUCT_BODY()
/** Database name*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Table")
FString DatabaseName = "";
/** Table name*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Table")
FString TableName = "";
/** Array with Fields*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Table")
TArray<FSQLiteTableField> Fields;
/** Primary Key */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Table")
FSQLitePrimaryKey PK;
/** Created Key */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Table")
bool Created = false;
};

SQLiteDatabaseStructs.generated.h:

// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
===========================================================================*/
#include "UObject/ObjectMacros.h"
#include "UObject/ScriptMacros.h"
PRAGMA_DISABLE_DEPRECATION_WARNINGS
#ifdef CISQLITE3_SQLiteDatabaseStructs_generated_h
#error "SQLiteDatabaseStructs.generated.h already included, missing '#pragma once' in SQLiteDatabaseStructs.h"
#endif
#define CISQLITE3_SQLiteDatabaseStructs_generated_h
#define MiningTechDemo5_Plugins_CISQLite3_Source_CISQLite3_Public_SQLiteDatabaseStructs_h_66_GENERATED_BODY 
friend struct Z_Construct_UScriptStruct_FSQLiteTable_Statics; 
static class UScriptStruct* StaticStruct();

#define MiningTechDemo5_Plugins_CISQLite3_Source_CISQLite3_Public_SQLiteDatabaseStructs_h_55_GENERATED_BODY 
friend struct Z_Construct_UScriptStruct_FSQLiteTableRowSimulator_Statics; 
static class UScriptStruct* StaticStruct();

#define MiningTechDemo5_Plugins_CISQLite3_Source_CISQLite3_Public_SQLiteDatabaseStructs_h_32_GENERATED_BODY 
friend struct Z_Construct_UScriptStruct_FSQLiteTableField_Statics; 
static class UScriptStruct* StaticStruct();

#define MiningTechDemo5_Plugins_CISQLite3_Source_CISQLite3_Public_SQLiteDatabaseStructs_h_22_GENERATED_BODY 
friend struct Z_Construct_UScriptStruct_FSQLitePrimaryKey_Statics; 
static class UScriptStruct* StaticStruct();

#define MiningTechDemo5_Plugins_CISQLite3_Source_CISQLite3_Public_SQLiteDatabaseStructs_h_7_GENERATED_BODY 
friend struct Z_Construct_UScriptStruct_FSQLiteIndex_Statics; 
static class UScriptStruct* StaticStruct();

#undef CURRENT_FILE_ID
#define CURRENT_FILE_ID MiningTechDemo5_Plugins_CISQLite3_Source_CISQLite3_Public_SQLiteDatabaseStructs_h

PRAGMA_ENABLE_DEPRECATION_WARNINGS

SQLiteDatabase.h:

#pragma once
#include "sqlite3.h"
#include "SQLiteBlueprintNodes.h"
#include "SQLiteDatabaseStructs.h"
#include "F:/UE4/Projects/MiningTechDemo5/Plugins/CISQLite3/Intermediate/Build/Win64/UE4Editor/Inc/CISQLite3/SQLiteDatabase.generated.h"
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteDatabaseReference
{
GENERATED_USTRUCT_BODY()
/** The database name (not the filename) */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Database Reference")
FString DatabaseName;
/** The database tables we want to get data from */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Database Reference")
TArray<FString> Tables;
};
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteKeyValuePair
{
GENERATED_USTRUCT_BODY()
/** The database table field name */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Key Value Pair")
FString Key;
/** The value of the field */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Key Value Pair")
FString Value;
};
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteQueryResultRow
{
GENERATED_USTRUCT_BODY()
/** A list of field name, field value pairs */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Query Result")
TArray<FSQLiteKeyValuePair> Fields;
};
USTRUCT(BlueprintType)
struct CISQLITE3_API FSQLiteQueryResult
{
GENERATED_USTRUCT_BODY()
/** The resulting rows from the query */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SQLite Query Result")
TArray<FSQLiteQueryResultRow> ResultRows;
/** Was the query successful or not */
UPROPERTY(BlueprintReadOnly, Category = "SQLite Query Result")
bool Success;
/** If the query was unsuccessful a human readable error message will be populated here */
UPROPERTY(BlueprintReadOnly, Category = "SQLite Query Result")
FString ErrorMessage;
};

// A few things for internal use here.
namespace SQLiteResultValueTypes
{
enum SQLiteResultValType
{
Integer,
Float,
Text,
UnsupportedValueType
};
}
// Result field, used as an intermediary when collecting results from
// an SQLITE3 query.
struct SQLiteResultField
{
FString StringValue;
double DoubleValue;
int64 IntValue;
FString Name;
SQLiteResultValueTypes::SQLiteResultValType Type;
FString ToString()
{
if (Type == SQLiteResultValueTypes::Text)
return StringValue;
else if (Type == SQLiteResultValueTypes::Integer)
return FString::Printf(TEXT("%i"), IntValue);
else if (Type == SQLiteResultValueTypes::Float)
return FString::Printf(TEXT("%f"), DoubleValue);
return StringValue;
}
};
// Represents a single row in the result.
struct SQLiteResultValue
{
TArray<SQLiteResultField> Fields;
};
// The internal result object.
struct SQLiteQueryResult
{
bool Success;
FString ErrorMessage;
TArray<SQLiteResultValue> Results;
};

/**
* SQLite main database class.
*/
UCLASS()
class CISQLITE3_API USQLiteDatabase : public UObject
{
GENERATED_UCLASS_BODY()
public:
/** Create a sqlite database file if it doesn't exist already. Does nothing if already exists.
*   Returns false if the file couldn't be created */
UFUNCTION(BlueprintCallable, Category = "SQLite")
static bool CreateDatabase(const FString& Filename, bool RelativeToGameContentDirectory);
/** Checks if the database is registered, ie. that it can be found in Databases. */
/** Add a database to the list of databases. It will be checked that it's valid (will try to open it) */
UFUNCTION(BlueprintCallable, Category = "SQLite")
static bool RegisterDatabase(const FString& Name, const FString& Filename, bool RelativeToGameContentDirectory, bool KeepOpen=false);
/** Remove a database from the list of databases. Closes the database in case KeepOpen flag was set during @ref RegisterDatabase */
UFUNCTION(BlueprintCallable, Category = "SQLite")
static void UnregisterDatabase(const FString& Name);
/** Checks if the database is registered, ie. that it can be found in Databases. */
UFUNCTION(BlueprintCallable, Category = "SQLite")
static bool IsDatabaseRegistered(const FString& DatabaseName);
/** Get data from the database using a select statement straight into an UObject, ie. populates its properties. */
UFUNCTION(BlueprintCallable, Category = "SQLite", meta = (DisplayName = "Get Data Into Object (manual query)"))
static bool GetDataIntoObject(const FString& DatabaseName, const FString& Query, UObject* ObjectToPopulate);
/** Blueprint: Gets data from the database using a select statement straight into an UObject, ie. populates its properties.
*   Note: Does not create a new object. ObjectToPopulate is the reference to the object you want to populate. */
UFUNCTION(BlueprintCallable, Category = "SQLite", meta = (DisplayName = "Get Data Into Object"))
static bool GetDataIntoObjectBP(const FSQLiteDatabaseReference& DataSource, TArray<FString> Fields, FSQLiteQueryFinalizedQuery Query, UObject* ObjectToPopulate);
/** Get data from the database using a select statement and return the rows. */
UFUNCTION(BlueprintCallable, Category = "SQLite", meta = (DisplayName = "Get Data From Table(s) (manual query)"))
static FSQLiteQueryResult GetData(const FString& DatabaseName, const FString& Query);
/** Blueprint: Get data from the database. Returns the resulting rows. */
UFUNCTION(BlueprintCallable, Category = "SQLite", meta = (DisplayName = "Get Data From Table(s)"))
static FSQLiteQueryResult GetDataBP(const FSQLiteDatabaseReference& DataSource, TArray<FString> Fields, FSQLiteQueryFinalizedQuery Query, int32 MaxResults = -1, int32 ResultOffset = 0);
/** Create table in the database. */
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Create Table"))
static FSQLiteTable CreateTable(const FString& DatabaseName, const FString& TableName,
const TArray<FSQLiteTableField> Fields, const FSQLitePrimaryKey PK);
/** Create indexes for table */
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Create Indexes"))
static bool CreateIndexes(const FString& DatabaseName, const FString& TableName, const TArray<FSQLiteIndex> Indexes);
/** Create index for table */
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Create Index"))
static bool CreateIndex(const FString& DatabaseName, const FString& TableName, const FSQLiteIndex Index);
/** Drop index*/
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Drop Index"))
static bool DropIndex(const FString& DatabaseName, const FString& IndexName);
/** Drop Table*/
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Drop Table"))
static bool DropTable(const FString& DatabaseName, const FString& TableName);
/** Truncate Table*/
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Truncate Table"))
static bool TruncateTable(const FString& DatabaseName, const FString& TableName);
/** Is table exists?*/
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Is table exists?"))
static bool IsTableExists(const FString& DatabaseName, const FString& TableName);
/** Insert rows into table */
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Insert Rows Into Table"))
static void InsertRowsIntoTable(const FString& DatabaseName, const FString& TableName, TArray<FSQLiteTableRowSimulator> rowsOfFields);
/** Compact database*/
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Compact database"))
static bool Vacuum(const FString& DatabaseName);
/** Execute SQL (can be used for insert statement)*/
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Execute SQL"))
static bool ExecSql(const FString& DatabaseName, const FString& Query);
/** Checks database validity (if the file exists and/or if it can be opened). */
UFUNCTION(BlueprintCallable, Category = "SQLite|Query", meta = (DisplayName = "Is Valid Database"))
static bool IsValidDatabase(const FString& DatabaseFilename, bool TestByOpening);
/** Runs a query and returns fetched rows. */
static TUniquePtr<SQLiteQueryResult> RunQueryAndGetResults(const FString& DatabaseName, const FString& Query);
private:
/** Tries to open a database. */
static bool CanOpenDatabase(const FString& DatabaseFilename);
/** Collects all properties from an UObject and maps them by the property name. */
static TMap<FString, UProperty*> CollectProperties(UObject* SourceObject);
/** Constructs an SQL query from the blueprint fed data. */
static FString ConstructQuery(TArray<FString> Tables, TArray<FString> Fields, FSQLiteQueryFinalizedQuery QueryObject, int32 MaxResults = -1, int32 ResultOffset = 0);
/** Assigns a result row's fields' values to an UObject, ie. assigns them to the properties that have the same name. */
static void AssignResultsToObjectProperties(const SQLiteResultValue& ResultValue, UObject* ObjectToPopulate);
/** @brief Prepare given statement, returns whether to keep the database open */
static bool PrepareStatement(const FString& DatabaseName, const FString& Query, sqlite3** Db, int32** SqlReturnCode,
sqlite3_stmt** PreparedStatement);

private:
/** A list of the databases for convenience, easier to refer to them by name rather than a long filename. */
static TMap<FString, FString> Databases;
static TMap<FString, sqlite3*> SQLite3Databases;
};

PasteBin for SQLiteDatabase.generated.h,因为它太长而无法包含在问题正文中:

https://pastebin.com/ZFsg9KEv

在这一点上,我真的没有想法,我在网上找不到任何与此类似的插件。 不确定是否有人一直在使用它与最新版本的引擎一起使用。 任何帮助都将受到我自己和我电脑旁边的墙的极大赞赏。

因此,我设法通过直接将合并功能合并到新项目的源文件夹中来解决此问题,但我认为如果可以解决这个问题,UE4社区将整体受益。 虽然SQLite3集成有一些不错的插件,但它们的成本很高,如果你不需要花里胡哨的东西,它们就不划算了。