4>editorInterfaceService.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl tgui::RAYLIB::Gui::~Gui(void)" (__imp_??1Gui@RAYLIB@tgui@@UEAA@XZ) referenced in function "public: virtual void * __cdecl tgui::RAYLIB::Gui::`scalar deleting destructor'(unsigned int)" (??_GGui@RAYLIB@tgui@@UEAAPEAXI@Z)
4>aboutWindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl tgui::Texture::Texture(char const *,class tgui::Rect<unsigned int> const &,class tgui::Rect<unsigned int> const &,bool)" (__imp_??0Texture@tgui@@QEAA@PEBDAEBV?$Rect@I@1@1_N@Z) referenced in function "public: __cdecl AboutWindow::AboutWindow(struct Rectangle)" (??0AboutWindow@@QEAA@URectangle@@@Z)
4>..\..\build\windows\x64\debug\editor.exe : fatal error LNK1120: 3 unresolved externals
# "Enable C++ exceptions" and "Enable C++ run-time type info (RTTI)" must be checked in menuconfig
idf_component_register(SRCS test.cpp
INCLUDE_DIRS ".")
set(TGUI_BACKEND "Custom")
set(CMAKE_SYSTEM_NAME "Linux")
set(BUILD_SHARED_LIBS OFF)
set(TGUI_INSTALL OFF)
add_subdirectory(TGUI)
target_link_libraries(${COMPONENT_LIB} PUBLIC TGUI::TGUI)
#include <fstream> // To save files
#include <stdio.h> // To delete files
// Define some types and functions because if we use Windows.h, an error appears: you cannot override the WinMain() function.
using DWORD = uint32_t;
using LPVOID = void*;
typedef void* HINSTANCE;
typedef wchar_t WCHAR;
typedef const char* LPCSTR;
typedef const WCHAR* LPWCSTR;
typedef unsigned int UINT;
typedef void* HGLOBAL;
typedef void* HRSRC;
typedef void* HMODULE;
extern "C" {
HRSRC FindResourceA(HMODULE hModule, LPCSTR lpName, LPCSTR lpType);
HRSRC FindResourceW(HMODULE hModule, LPWCSTR lpName, LPWCSTR lpType);
HGLOBAL LoadResource(HMODULE hModule, HRSRC hResInfo);
void* LockResource(HGLOBAL hResData);
unsigned int SizeofResource(HMODULE hModule, HRSRC hResInfo);
}bool SaveResourceToFile(const WCHAR* resourceName, const WCHAR* resourceType, const WCHAR* outputFilePath)
{
// Find a resource
HRSRC hResource = FindResourceW(NULL, resourceName, resourceType);
if (hResource == NULL) {
return false;
}
// Load a resource
HGLOBAL hMemory = LoadResource(NULL, hResource);
if (hMemory == NULL) {
return false;
}
// Get resource size
DWORD resourceSize = SizeofResource(NULL, hResource);
if (resourceSize == 0) {
return false;
}
// Get a pointer to the resource data
LPVOID resourceData = LockResource(hMemory);
if (resourceData == NULL) {
return false;
}
// Write data to file
std::ofstream outputFile(outputFilePath, std::ios::binary);
if (!outputFile.is_open()) {
return false;
}
outputFile.write(static_cast<const char*>(resourceData), resourceSize);
outputFile.close();
return true;
}SaveResourceToFile(L"#101",L"PNG",L"TempFileScannerIcon.png"); // Saving files
SaveResourceToFile(L"#103",L"TXT",L"TempFileScannerWidgetsList.txt");
// ...
// Using our files
// ...
remove("TempFileScannerIcon.png"); // Removing files
remove("TempFileScannerWidgetsList.txt");sf::RenderWindow window(sf::VideoMode(sf::Vector2u(800, 600)), "Disk Manager", sf::State::Windowed, sf::ContextSettings());
tgui::Gui gui(window);I then had to replace some "gui" references inside the setupWidgets function to "ui". After that your program compiled and started fine.