VRlxtech / MySQL-Database-Connector-Plugin-for-Unreal-Engine-5

Updated from MySQLConnectorUE4Plugin
MIT License
10 stars 1 forks source link

Problem connection on last version #3

Open lcdlv opened 1 year ago

lcdlv commented 1 year ago

Hi! I was using an hybrid version (you send me a patch for one uasset file) and this versions connects to my db and works fine, but I have problem to compile for windows.

UATHelper: Packaging (Windows): Building 2 actions with 2 processes... UATHelper: Packaging (Windows): [1/2] WriteMetadata MetaverseMall-Win64-Shipping.target canceled UATHelper: Packaging (Windows): [2/2] Link [x64] MetaverseMall-Win64-Shipping.exe UATHelper: Packaging (Windows): libblosc.lib(blosc.obj) : error LNK2005: pthread_cond_destroy already defined in mariadbclient.lib(my_pthread.obj) UATHelper: Packaging (Windows): libblosc.lib(blosc.obj) : error LNK2005: pthread_cond_init already defined in mariadbclient.lib(my_pthread.obj) UATHelper: Packaging (Windows): libblosc.lib(blosc.obj) : error LNK2005: pthread_cond_wait already defined in mariadbclient.lib(my_pthread.obj) UATHelper: Packaging (Windows): Creating library D:\Github\Go2Virtual\Binaries\Win64\MetaverseMall-Win64-Shipping.lib and object D:\Github\Go2Virtual\Binaries\Win64\MetaverseMall-Win64-Shipping.exp UATHelper: Packaging (Windows): D:\Github\Go2Virtual\Binaries\Win64\MetaverseMall-Win64-Shipping.exe : fatal error LNK1169: One or more simultaneously defined symbols found UATHelper: Packaging (Windows): Took 30.184881700000002s to run dotnet.exe, ExitCode=6

So, I download your last version and I can export for windows again, but the connection to my DB dosn't work... I upload the version that work with my DB, and if you can check whats the difference I will appreciate you.

https://drive.google.com/file/d/1A0oA5Z4ZKtX9h3SAIAt26_iiv_QudAUU/view?usp=sharing

The error with the new version it's the same like before:

LogTemp: Error: Can't initialize character set unknown (path: compiled_in) LogTemp: Error: MySQLInitConnection: Failed to Connect to Database! LogTemp: Error: MySQLCloseConnection: Connection is valid but Server does no respond!

But is the same DB that work with the old version. Thanks!

VRlxtech commented 1 year ago

The Error you are getting is wrong library for MYSQL or you have another MYSQL library with the same same on other plugin, to fix, you need to point the library:

          MySQLConnectorUE5Plugin.Build.cs  - **check this location for library**
          MariaDBConnectorLibs.Build.cs - what library 

if (Target.Platform == UnrealTargetPlatform.Win64) { // Add the import library //PublicLibraryPaths.Add(Path.Combine(ModuleDirectory, "MariaDB_Connector_C_64-bit/lib", "lib")); //PublicAdditionalLibraries.Add("libmariadb.lib"); PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "MariaDB_Connector_C_64-bit/lib", "mariadbclient.lib"));

        // Delay-load the DLL, so we can load it from the right place first 
        //PublicDelayLoadDLLs.Add("libmariadb.dll");                

        //PublicLibraryPaths.Add(Path.Combine(ModuleDirectory, "MariaDB Connector C 64-bit", "lib", "plugin"));
        // Delay-load the DLL, so we can load it from the right place first     
        //PublicDelayLoadDLLs.Add("dialog.dll");
        //PublicDelayLoadDLLs.Add("mysqlclearpassword.dll");

    }   

I Changed to

   if (Target.Platform == UnrealTargetPlatform.Win64)
    {
        // Add the import library
        //PublicLibraryPaths.Add(Path.Combine(ModuleDirectory, "MariaDB_Connector_C_64-bit/lib", "lib")); 
        //PublicAdditionalLibraries.Add("libmariadb.lib");
        //PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "MariaDB_Connector_C_64-bit/lib", "mariadbclient.lib"));
        PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "MariaDB_Connector_C_64-bit\\lib", "mariadbclient.x64.lib"));

        //PublicAdditionalLibraries.Remove("libblosc.lib");
        // Delay-load the DLL, so we can load it from the right place first 
        //PublicDelayLoadDLLs.Add("libmariadb.dll");                

        //PublicLibraryPaths.Add(Path.Combine(ModuleDirectory, "MariaDB Connector C 64-bit", "lib", "plugin"));
        // Delay-load the DLL, so we can load it from the right place first     
        //PublicDelayLoadDLLs.Add("dialog.dll");
        //PublicDelayLoadDLLs.Add("mysqlclearpassword.dll");

    }   

I have complied to all 5 version with no problems, but the error you are getting is the basic library and unreal only compiles when you are ready to release project to win64.

Good Luck D