0
votes

There is an abandoned project, that builds correctly in 32bit version, but I need 64bit version of it. I tried to change project setting to x64 in visual studio, but when I click build I get lots of errors. Here are the visual studio files. And here is more info about the project. I have no experience with VS and c++.

This is a DLL, that makes connection between MT5 platform and MySQL, using libmysql.dll. I would like to read and write data to/from MySQL using MT5.

I would appreciate if you could help me to convert this to 64 bits, the 32 bit version can not be loaded to MT5.

Here are the first 5 error:

1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_num_rows referenced in function "int __cdecl cMySqlCursorRows(int)" (?cMySqlCursorRows@@YAHH@Z)
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_num_fields referenced in function "wchar_t * __cdecl cMySqlGetRowField(int,unsigned int)" (?cMySqlGetRowField@@YAPEA_WHI@Z)
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_errno referenced in function "bool __cdecl MySqlExecute(int,wchar_t *)" (?MySqlExecute@@YA_NHPEA_W@Z)
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_error referenced in function "bool __cdecl MySqlExecute(int,wchar_t *)" (?MySqlExecute@@YA_NHPEA_W@Z)
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_init referenced in function "int __cdecl cMySqlConnect(wchar_t *,wchar_t *,wchar_t *,wchar_t *,int,wchar_t *,int)" (?cMySqlConnect@@YAHPEA_W000H0H@Z)
1>MQLMySQL.obj : error LNK2019: unresolved external symbol mysql_real_connect referenced in function "int __cdecl cMySqlConnect(wchar_t *,wchar_t *,wchar_t *,wchar_t *,int,wchar_t *,int)" (?cMySqlConnect@@YAHPEA_W000H0H@Z)
1
What are the errors? Have you tried fixing them? Don't ask SO to do it for you. - ChrisMM
Pick the 1st 5 errors messages and list them as part of the question. - Richard Critten
Of courser I tried to fix it, but I have 0 experience with c++ and I don't think this is a beginner project. - zsss

1 Answers

0
votes

From the first 5 errors you've had, it looks like a linker issue. Most compiled languages compile the source (c++) code into object files and then link them with existing libraries. If the source compiles, but you can't link to the external libraries (for example they aren't installed) then you'll get errors like you've described.

Is there an external library that you need to reference, or are all of your source files organized in such a way that they can reference each other?