0
votes

I'm working with the C++ MySQL Connector, and have configured it properly (.libs linked properly, etc), but however I am getting a LNK2019 error.

I've had this error before, and it generally means that I don't have the library I need, linked to the project. I have double checked that the library for MySQL Connector is seen by Visual Studio (I made a purposeful spelling mistake in the filename of the .lib, and it reported that it could not find the file), but I'm still getting the LNK2019 error.

The code I'm using with the MySQL Connector is here: http://pastebin.com/hKQ4ikgR

What exactly am I doing wrong? Should I link the .lib in the file? I've done some searching on this specific error with the MySQL Connector, and my search returned quite a few results, but however these results had no answers.

The specific error:

Error 7 error LNK2019: unresolved external symbol mysql_store_result referenced in function "void __cdecl FuSIONConnect(void)" (?FuSIONConnect@@YAXXZ) C:\FuSION\Mods\FuSIONClient\Code\FuSIONMySQL.obj GameDll Error 5 error LNK2019: unresolved external symbol mysql_real_connect referenced in function "void __cdecl FuSIONConnect(void)" (?FuSIONConnect@@YAXXZ) C:\FuSION\Mods\FuSIONClient\Code\FuSIONMySQL.obj GameDll Error 6 error LNK2019: unresolved external symbol mysql_query referenced in function "void __cdecl FuSIONConnect(void)" (?FuSIONConnect@@YAXXZ) C:\FuSION\Mods\FuSIONClient\Code\FuSIONMySQL.obj GameDll Error 3 error LNK2019: unresolved external symbol mysql_num_rows referenced in function "void __cdecl FuSIONConnect(void)" (?FuSIONConnect@@YAXXZ) C:\FuSION\Mods\FuSIONClient\Code\FuSIONMySQL.obj GameDll Error 4 error LNK2019: unresolved external symbol mysql_init referenced in function "void __cdecl FuSIONConnect(void)" (?FuSIONConnect@@YAXXZ) C:\FuSION\Mods\FuSIONClient\Code\FuSIONMySQL.obj GameDll Error 8 error LNK2019: unresolved external symbol mysql_fetch_row referenced in function "void __cdecl FuSIONConnect(void)" (?FuSIONConnect@@YAXXZ) C:\FuSION\Mods\FuSIONClient\Code\FuSIONMySQL.obj GameDll Error 9 error LNK2019: unresolved external symbol mysql_close referenced in function "void __cdecl FuSIONConnect(void)" (?FuSIONConnect@@YAXXZ) C:\FuSION\Mods\FuSIONClient\Code\FuSIONMySQL.obj GameDll

1

1 Answers

1
votes

I found out that the version of MySQL Connector was x86-only. I solved this by compiling in x86, but am still unable to compile in x64.

The easiest way to get the x64 version is to use the NuGet Package Manager.