• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Almost finished compiling annnd unsolvable errror

Thogora

New Member
Joined
Apr 28, 2020
Messages
9
Reaction score
0
Hello OtLand.

I think I am close to finishing compiling TFS1.3 and now I got an error that I cannot solve so I need some help so I can keep on working and get my server up and running.
Using MSVC 2019. The error I am stuck at is "C2664" and it says "'int mysql_options(MYSQL *,mysql_option,const char *)': cannot convert argument 3 from 'bool *' to 'const char *'
The error is in "database.cpp" in line 47 and the code is:
Lua:
mysql_options(handle, MYSQL_OPT_RECONNECT, &reconnect);
Tried Google to find a solution but I did not find anything that could help me, probably my programming skills that are not enough.

Also I do have over 300 warnings (most of them are the same warning code) and I do wonder do I need to worry about them?

If any more information is needed please say so and I will provide it.

Kind Regards
Thogora
 
Solution
It is sad to see that such simple questions lack of response. I don't know whether community truly doesn't know the solution or no one wants the help. Anyway, simply cast it as mysql_options requires const char* as third parameter (yet bool * is provided):

mysql_options(handle, MYSQL_OPT_RECONNECT, (char*)&reconnect);

No need to cast to const as it is implicit via the parameter type itself. Anyway, I think in some version of MySQL library (I don't know whether an older one or newer one) the third parameter to mysql_options is void * which then can accept any pointer without casting and it wouldn't complain about that.

Regarding the warnings it depends on the warning itself.
It is sad to see that such simple questions lack of response. I don't know whether community truly doesn't know the solution or no one wants the help. Anyway, simply cast it as mysql_options requires const char* as third parameter (yet bool * is provided):

mysql_options(handle, MYSQL_OPT_RECONNECT, (char*)&reconnect);

No need to cast to const as it is implicit via the parameter type itself. Anyway, I think in some version of MySQL library (I don't know whether an older one or newer one) the third parameter to mysql_options is void * which then can accept any pointer without casting and it wouldn't complain about that.

Regarding the warnings it depends on the warning itself.
 
Solution
@Iryont It works and thanks for explaining the error for me!

About all my warnings, I got 331 C4100, 3x C4189 and 3x C4297. Have not looked in to them yet, might be a simple solution's. Hopefully I will be able to look in them them in the upcoming few days.

Kind regards
Thogora
 
Back
Top