I king of solved the error by usng *mysqlcppconn.lib*  instead of 
*mysqlcppconn-static.lib 
*.
With this the plugin compiled OK, but when l load it in maya a get a 
Dynamic load error.
Anyways, I ended up using MySql in python which is a lot easier, but it 
would be cool to trying to run mysql directly in C++ in a maya plugin.

Cheers

El lunes, 1 de mayo de 2023 a las 12:11:52 UTC+2, Rudi Hammad escribió:

> hello,
> first of all, let me know if this is out the scope of this forum to post 
> it somewhere else.
> I post it here because it is related to maya anyways and might also be 
> valid for the python api.
>
> Anyways, I want to connect my maya plugins to my data base. I did that 
> already creating an empty windows projects and everything work as expected. 
> The connection was successful.
> Here is the working code:
> https://pastebin.com/UFEn99v7
> (of course set the sensible data as "xxxxx")
>
> For this to work I set visual studio as follows:
> *- C/C++ | General | addition include directories -> C:\Program 
> Files\MySQL\Connector C++ 8.0\include\jdbc* 
>
> *- C/C++ | prepocessor | preprocessor Definitions add STATIC_CONCPP *
> *- C/C++ | Code Generatin| Runtime library -> Multi-threaded DLL (/MD)* 
> *- Linker | General | additional library directories -> add C:\Program 
> Files\MySQL\Connector C++ 8.0\lib64\vs14* 
> *- Linker | Input | additional dependencies -> add mysqlcppconn-static.lib*
>
>
> So then I went to a working Maya Plugin I wrote and tried to add that 
> same code, adding to the existing visual studio setup the paths above. And 
> I gave me an error when it runs: get_driver_instance(); 
> Here  is the error
>
> 1>mysqlcppconn-static.lib(my_init.obj) : error LNK2001: unresolved 
> external symbol __imp_RegCloseKey
> 1>mysqlcppconn-static.lib(my_init.obj) : error LNK2001: unresolved 
> external symbol __imp_RegEnumValueA
> 1>mysqlcppconn-static.lib(my_init.obj) : error LNK2001: unresolved 
> external symbol __imp_RegOpenKeyExA
> 1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
> symbol __imp_EqualSid
> 1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
> symbol __imp_GetTokenInformation
> 1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
> symbol __imp_IsValidSid
> 1>mysqlcppconn-static.lib(common.obj) : error LNK2001: unresolved external 
> symbol __imp_LookupAccountNameW
>
> I have been googling to solve this, but linking errors are a bit advanced 
> for me to know exactly what is wrong. I looked into this forum about mysql 
> topics but didn't find an answer to setup maya and mysql. And I only found 
> in the maya docs this :
>
>
> https://help.autodesk.com/view/MAYAUL/2023/ENU/?caas=caas/sfdcarticles/sfdcarticles/Installing-and-configuring-the-MySQL-Client-on-Windows-s.html
>
> My guess is that it must be some specific version that works with maya 
> (the doc mentions MySQL 5.0.27) but I think it must be more complicated 
> that.
> So before breaking my visual studio setup I prefered to ask here, even 
> though I am aware it might be a bit of an advanced topic.
>
> Anyway, please let me know what you think.
> Thx,
>
> R
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/f0468dcd-f4d0-4e9f-bfab-a3c38d5db992n%40googlegroups.com.

Reply via email to