Question
What is the intended way to access class definitions and functions from a third party library that is contained in its own plugin module?
Project Background
For the purpose of this exercise, I am trying to include the SQLite3 C++ library into Unreal. I am working from the Third Party Library template and adapting it as needed. So far I have the required lib and header files in the correct directories and I have configured the Build.cs files.
I have not yet touched the default header files or source files of the plugin:
// SQLite3.h
#pragma once
#include "Modules/ModuleManager.h"
class SQLITE3_API FSQLite3Module : public IModuleInterface
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};
The project builds successfully and I am able to include the headers “SQLite3.h” into a new C++ class. Within this new class, I can write something like
FSQLite3Module* SQLite3Plugin = FModuleManager::GetModulePtr<FSQLite3Module>("SQLite3");
and it works, so I’m confident that everything is likely working as intended so far.
My Goal
I want to be able to use the functions and objects from the SQLite3 library. In particular, I want to adapt the code from this tutorial and run it from inside the BeginPlay() method of a new Actor.
Here is an abridged code snippet I would like to adapt:
// SQLite3 library code to adapt
sqlite3 *db;
sqlite3_open("test.db", &db);
sqlite3_close(db);
These classes and functions are all part of the sqlite3 library and I want to know how I’m supposed to access them from my plugin.
My Background
I’m a bit of a novice C++ programmer and I’m new to Unreal, so please excuse me if things are not clear in this post. I’ll try my best to supply any additional information that’s needed.