1

Topic: Developing mod with MySQL, errors of compile

I do registration system, using mysql. In case of compilation I had errors.

=== Setup by Botox ===
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

=== Building Teeworlds Server ===
Процесс не найден: teeworlds_srv
[1/2] #1 c++ src/game/server/gamecontext.cpp
c:\tee\tee\src\game\server\gamecontext.cpp(648) : warning C4700: uninitialized l
ocal variable 'msqQueryReg' used
[2/2] #1 link teeworlds_srv.exe
mysqlclient.lib(my_init.obj) : error LNK2019: unresolved external symbol __imp__
RegCloseKey@4 referenced in function _win_init_registry
mysqlclient.lib(my_init.obj) : error LNK2019: unresolved external symbol __imp__
RegEnumValueA@32 referenced in function _win_init_registry
mysqlclient.lib(my_init.obj) : error LNK2019: unresolved external symbol __imp__
RegOpenKeyExA@20 referenced in function _win_init_registry
mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__I
sValidSid@4 referenced in function "public: bool __thiscall Sid::is_valid(void)c
onst " (?is_valid@Sid@@QBE_NXZ)
mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__E
qualSid@8 referenced in function "public: bool __thiscall Sid::operator==(class
Sid const &)" (??8Sid@@QAE_NABV0@@Z)
mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__L
ookupAccountNameW@28 referenced in function "public: __thiscall Sid::Sid(wchar_t
 const *)" (??0Sid@@QAE@PB_W@Z)
mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__G
etTokenInformation@20 referenced in function "public: __thiscall Sid::Sid(void *
)" (??0Sid@@QAE@PAX@Z)
mysqlclient.lib(random.obj) : error LNK2019: unresolved external symbol __imp__C
ryptAcquireContextA@20 referenced in function "public: __thiscall TaoCrypt::OS_S
eed::OS_Seed(void)" (??0OS_Seed@TaoCrypt@@QAE@XZ)
mysqlclient.lib(random.obj) : error LNK2019: unresolved external symbol __imp__C
ryptReleaseContext@8 referenced in function "public: __thiscall TaoCrypt::OS_See
d::~OS_Seed(void)" (??1OS_Seed@TaoCrypt@@QAE@XZ)
mysqlclient.lib(random.obj) : error LNK2019: unresolved external symbol __imp__C
ryptGenRandom@12 referenced in function "public: void __thiscall TaoCrypt::OS_Se
ed::GenerateSeed(unsigned char *,unsigned int)" (?GenerateSeed@OS_Seed@TaoCrypt@
@QAEXPAEI@Z)
teeworlds_srv.exe : fatal error LNK1120: 10 unresolved externals
bam: 'teeworlds_srv.exe' error 1120
bam: error: a build step failed
Не удается найти файл teeworlds_srv.exe.
=== Finished ===

I need to add some library or then? In bam.lua i added
    server_settings.link.libs:Add("mysqlclient")
    server_settings.link.libs:Add("libmysql")
And i have libmysql.dll, where and how i can add this library?
Please help me! Thanks in advance.

2

Re: Developing mod with MySQL, errors of compile

Remove the objs/ folder and try again.

Not Luck, Just Magic.

3

Re: Developing mod with MySQL, errors of compile

You have to link the missing libraries. They seem to be some windows library, something called "Sid" and TaoCrypt.

4

Re: Developing mod with MySQL, errors of compile

Deleting of objs folder, not help sad
I dont know what the libraries i have to link. In folde "include" at mysql, not found TaoScript and Sid (search in files).

5 (edited by Matodor 2013-03-03 08:56:52)

Re: Developing mod with MySQL, errors of compile

#if defined(CONF_FAMILY_WINDOWS)
    #pragma comment(lib, "C:\\Program Files (x86)\\MySQL\\MySQL Server 5.5\\lib\\libmysql.lib")
#else
    #pragma comment(lib, "/usr/lib/libmysqlclient.so.16.0.0")
#endif

Use this or for other lib.

6

Re: Developing mod with MySQL, errors of compile

Where i need to add it? I added it in gamecontext.h, but errors stay. Can you say details?
Thank you.

7

Re: Developing mod with MySQL, errors of compile

Example - http://linuxfocus.berlios.de/Russian/Se … e304.shtml

MaxCroud wrote:

Where i need to add it? I added it in gamecontext.h, but errors stay. Can you say details?
Thank you.

Where are using MySQL.

8 (edited by 2013-03-04 13:15:20)

Re: Developing mod with MySQL, errors of compile

I added this if-else block into gamecontext.cpp, but i use windows and when i compile i have fatal error - code use directory for linux. But why?

Matodor, thx! Its very helpfull information!