Jump to content
metin2dev
arves100

[HowTo] Upgrading server source into Mariadb connector c

Recommended Posts

Hello, here's a tutorial on how to update your MySQL Connector C (i think it's not supported anymore thanks oracle @.@) into MariaDB Connector C extracted from my source.

You must need MariaDB, if you use MySQL with this connector don't ask help because it's not ment to be compatible.

With this edit you could use MariaDB Connector v3.x without any problem.

 

1) Makefile update

Open your libsql, db and game makefile and on the CFLAGS/IFLAGS add this:

-I<your Extern source>/include/mariadb (ie.: ../Extern/include/mariadb)

Also, if you have a -I referencing mysql please delete it

Then, add this to your libsql, db and game CFLAGS this

-D__MARIADB__

Finally, change on your db and game LIBS this

-lmysqlclient 

into

-lmariadbclient -lssl -lcrypto

NOTE: If you already link libssl and libcrypto you can skip them

NOTE ON 64BIT ENVIRONMENT:

Spoiler

If you are on a 64bit environment (like me) you can't directly build mariadb or mysql connector, you must need a jail or x86 environment.

Also, the linker will select the wrong libssl and libcrypto library, so you should change


-lssl -lcrypto

INTO


-lssl32 -lcrypto32

Once you've done this, copy from your 32bit machine
 


/usr/lib/libssl.a to Extern/lib/libssl32.a

/usr/lib/libcrypto.a to Extern/lib/libcrypto32.a

REMEMBER TO ADD "32" AT THE END OF THE NAME ELSE THE LINKER WON'T LOAD THEM

You MUST use this library from a 32-bit build of your FreeBSD version, for instance: if i have FreeBSD 11.1 on my 64bit machine i have to use FreeBSD 11.1 32bit libraries

2) Source Update

Edit this code from libsql/AsyncSQL.h:

    #include <mysql/mysql.h>
    #include <mysql/errmsg.h>
    #include <mysql/mysqld_error.h>

into:

#ifdef __MARIADB__
    #include <mariadb/mysql.h>
    #include <mariadb/errmsg.h>
    #include <mariadb/mysqld_error.h>
#else
    #include <mysql/mysql.h>
    #include <mysql/errmsg.h>
    #include <mysql/mysqld_error.h>
#endif

Edit this code on db/DBManager.h

    #include <mysql/mysql.h>

into this:

#ifdef __MARIADB__
    #include <mariadb/mysql.h>
#else
    #include <mysql/mysql.h>
#endif

Finally, edit this file on libsql/AsyncSQL.cpp

fprintf(stdout, "AsyncSQL: connected to %s (reconnect %d)\n", m_stHost.c_str(), m_hDB.reconnect);

into:

#ifdef __MARIADB__
    fprintf(stdout, "AsyncSQL: connected to %s\n", m_stHost.c_str());
#else
    fprintf(stdout, "AsyncSQL: connected to %s (reconnect %d)\n", m_stHost.c_str(), m_hDB.reconnect);
#endif

3) Database Server Update

Now we're gonna replace the name "window" because MariaDB introduce the window operator that conflict with the query name

What we will basicly do is change any "window" in query into "windows"

db/AuctionManager.cpp function LoadAuctionItem()

Replace: 

FROM item WHERE window = 'AUCTION'

To:

FROM item WHERE windows = 'AUCTION'

db/ClientManagerPlayer.cpp

Replace:

		/////////////////////////////////////////////
		// 2) 아이템이 DBCache 에 없음 : DB 에서 가져옴 
		/////////////////////////////////////////////
		else
		{
			snprintf(szQuery, sizeof(szQuery), 
					"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "
					"FROM item%s WHERE owner_id=%d AND (window < %d or window = %d)",
					GetTablePostfix(), pTab->id, SAFEBOX, DRAGON_SOUL_INVENTORY);

			CDBManager::instance().ReturnQuery(szQuery,
					QID_ITEM,
					peer->GetHandle(),
					new ClientHandleInfo(dwHandle, pTab->id));
	

into:

		/////////////////////////////////////////////
		// 2) 아이템이 DBCache 에 없음 : DB 에서 가져옴 
		/////////////////////////////////////////////
		else
		{
			snprintf(szQuery, sizeof(szQuery), 
					"SELECT id,windows+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "
					"FROM item%s WHERE owner_id=%d AND (windows < %d or windows = %d)",
					GetTablePostfix(), pTab->id, SAFEBOX, DRAGON_SOUL_INVENTORY);

			CDBManager::instance().ReturnQuery(szQuery,
					QID_ITEM,
					peer->GetHandle(),
					new ClientHandleInfo(dwHandle, pTab->id));
	

Also replace:

		ClientHandleInfo * pkInfo = new ClientHandleInfo(dwHandle, packet->player_id);
		pkInfo->account_id = packet->account_id;
		CDBManager::instance().ReturnQuery(queryStr, QID_PLAYER, peer->GetHandle(), pkInfo);

		//--------------------------------------------------------------
		// 아이템 가져오기 
		//--------------------------------------------------------------
		snprintf(queryStr, sizeof(queryStr),
				"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "
				"FROM item%s WHERE owner_id=%d AND (window < %d or window = %d)",
				GetTablePostfix(), packet->player_id, SAFEBOX, DRAGON_SOUL_INVENTORY);
		CDBManager::instance().ReturnQuery(queryStr, QID_ITEM, peer->GetHandle(), new ClientHandleInfo(dwHandle, packet->player_id));

Into:

		ClientHandleInfo * pkInfo = new ClientHandleInfo(dwHandle, packet->player_id);
		pkInfo->account_id = packet->account_id;
		CDBManager::instance().ReturnQuery(queryStr, QID_PLAYER, peer->GetHandle(), pkInfo);

		//--------------------------------------------------------------
		// 아이템 가져오기 
		//--------------------------------------------------------------
		snprintf(queryStr, sizeof(queryStr),
				"SELECT id,windows+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "
				"FROM item%s WHERE owner_id=%d AND (windows < %d or windows = %d)",
				GetTablePostfix(), packet->player_id, SAFEBOX, DRAGON_SOUL_INVENTORY);
		CDBManager::instance().ReturnQuery(queryStr, QID_ITEM, peer->GetHandle(), new ClientHandleInfo(dwHandle, packet->player_id));

Finally replace:

		snprintf(queryStr, sizeof(queryStr), "DELETE FROM player%s WHERE id=%d", GetTablePostfix(), pi->player_id);
		delete CDBManager::instance().DirectQuery(queryStr);

		snprintf(queryStr, sizeof(queryStr), "DELETE FROM item%s WHERE owner_id=%d AND (window < %d or window = %d)", GetTablePostfix(), pi->player_id, SAFEBOX, DRAGON_SOUL_INVENTORY);
		delete CDBManager::instance().DirectQuery(queryStr);

Into:

		snprintf(queryStr, sizeof(queryStr), "DELETE FROM player%s WHERE id=%d", GetTablePostfix(), pi->player_id);
		delete CDBManager::instance().DirectQuery(queryStr);

		snprintf(queryStr, sizeof(queryStr), "DELETE FROM item%s WHERE owner_id=%d AND (windows < %d or windows = %d)", GetTablePostfix(), pi->player_id, SAFEBOX, DRAGON_SOUL_INVENTORY);
		delete CDBManager::instance().DirectQuery(queryStr);

4) Query update

Design your player.item table, and change "window" to "windows".

 

We have update into the new connector (mariadb connector c 3.x safetly), if you would like to downgrade change -lmariadbclient into -lmysqlclient, remove -D__MARIADB__ and change the -I referencing mariadb into mysql.

Thanks for reading :)

 

UPDATE:

 

I've found other place to edit "window" into "windows"

 

Open ClientManager.cpp

From:

			else
				sys_log(0, "SAFEBOX id[%d] size[%d]", pSafebox->dwID, pSafebox->bSize);
		}

		if (0 == pSafebox->dwID)
			pSafebox->dwID = pi->account_id;

		pi->pSafebox = pSafebox;

		m2char szQuery[512];
		snprintf(szQuery, sizeof(szQuery), 
				"SELECT id, window+0, pos, count, vnum, socket0, socket1, socket2, "
				"attrtype0, attrvalue0, "
				"attrtype1, attrvalue1, "
				"attrtype2, attrvalue2, "
				"attrtype3, attrvalue3, "
				"attrtype4, attrvalue4, "
				"attrtype5, attrvalue5, "
				"attrtype6, attrvalue6 "
								
				"FROM item%s WHERE owner_id=%d AND window='%s'",
				GetTablePostfix(), pi->account_id, pi->ip[0] == 0 ? "SAFEBOX" : "MALL");

To:

			else
				sys_log(0, "SAFEBOX id[%d] size[%d]", pSafebox->dwID, pSafebox->bSize);
		}

		if (0 == pSafebox->dwID)
			pSafebox->dwID = pi->account_id;

		pi->pSafebox = pSafebox;

		m2char szQuery[512];
		snprintf(szQuery, sizeof(szQuery), 
				"SELECT id, windows+0, pos, count, vnum, socket0, socket1, socket2, "
				"attrtype0, attrvalue0, "
				"attrtype1, attrvalue1, "
				"attrtype2, attrvalue2, "
				"attrtype3, attrvalue3, "
				"attrtype4, attrvalue4, "
				"attrtype5, attrvalue5, "
				"attrtype6, attrvalue6 "
								
				"FROM item%s WHERE owner_id=%d AND windows='%s'",
				GetTablePostfix(), pi->account_id, pi->ip[0] == 0 ? "SAFEBOX" : "MALL");

From:

									else
										pItemAward->dwSocket0 = item_table->aLimits[i].lValue;

									break;
								}
							}
						}

						snprintf(szQuery, sizeof(szQuery), 
								"INSERT INTO item%s (id, owner_id, window, pos, vnum, count, socket0, socket1, socket2) "
								"VALUES(%u, %u, '%s', %d, %u, %u, %u, %u, %u)",
								GetTablePostfix(),
								GainItemID(),
								pi->account_id,
								pi->ip[0] == 0 ? "SAFEBOX" : "MALL",
								iPos,
								pItemAward->dwVnum, pItemAward->dwCount, pItemAward->dwSocket0, pItemAward->dwSocket1, dwSocket2);
					}

	

To:

									else
										pItemAward->dwSocket0 = item_table->aLimits[i].lValue;

									break;
								}
							}
						}

						snprintf(szQuery, sizeof(szQuery), 
								"INSERT INTO item%s (id, owner_id, windows, pos, vnum, count, socket0, socket1, socket2) "
								"VALUES(%u, %u, '%s', %d, %u, %u, %u, %u, %u)",
								GetTablePostfix(),
								GainItemID(),
								pi->account_id,
								pi->ip[0] == 0 ? "SAFEBOX" : "MALL",
								iPos,
								pItemAward->dwVnum, pItemAward->dwCount, pItemAward->dwSocket0, pItemAward->dwSocket1, dwSocket2);
					}

	

From:


			m_map_itemCache.erase(p->id);

			delete c;
		}
		m2char szQuery[512];

		snprintf(szQuery, sizeof(szQuery), 
			"REPLACE INTO item%s (id, owner_id, window, pos, count, vnum, socket0, socket1, socket2, "
			"attrtype0, attrvalue0, "
			"attrtype1, attrvalue1, "
			"attrtype2, attrvalue2, "
			"attrtype3, attrvalue3, "
			"attrtype4, attrvalue4, "
			"attrtype5, attrvalue5, "
			"attrtype6, attrvalue6 "
			") "
			"VALUES(%u, %u, %d, %d, %u, %u, %ld, %ld, %ld, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d"
			")",
			GetTablePostfix(),
			p->id,
			p->owner,
			p->window,

To:


			m_map_itemCache.erase(p->id);

			delete c;
		}
		m2char szQuery[512];

		snprintf(szQuery, sizeof(szQuery), 
			"REPLACE INTO item%s (id, owner_id, windows, pos, count, vnum, socket0, socket1, socket2, "
			"attrtype0, attrvalue0, "
			"attrtype1, attrvalue1, "
			"attrtype2, attrvalue2, "
			"attrtype3, attrvalue3, "
			"attrtype4, attrvalue4, "
			"attrtype5, attrvalue5, "
			"attrtype6, attrvalue6 "
			") "
			"VALUES(%u, %u, %d, %d, %u, %u, %ld, %ld, %ld, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d"
			")",
			GetTablePostfix(),
			p->id,
			p->owner,
			p->window,

 

UPDATE2: Open db/Cache.cpp and find:


		if (memcmp(aAttr, p->aAttr, sizeof(TPlayerItemAttribute) * ITEM_ATTRIBUTE_MAX_NUM))
			isAttr = true;

		char szColumns[QUERY_MAX_LEN];
		char szValues[QUERY_MAX_LEN];
		char szUpdate[QUERY_MAX_LEN];

		int iLen = snprintf(szColumns, sizeof(szColumns), "id, owner_id, window, pos, count, vnum");

		int iValueLen = snprintf(szValues, sizeof(szValues), "%u, %u, %d, %d, %u, %u",
				p->id, p->owner, p->window, p->pos, p->count, p->vnum);

		int iUpdateLen = snprintf(szUpdate, sizeof(szUpdate), "owner_id=%u, window=%d, pos=%d, count=%u, vnum=%u",
				p->owner, p->window, p->pos, p->count, p->vnum);

Replace into:


		if (memcmp(aAttr, p->aAttr, sizeof(TPlayerItemAttribute) * ITEM_ATTRIBUTE_MAX_NUM))
			isAttr = true;

		char szColumns[QUERY_MAX_LEN];
		char szValues[QUERY_MAX_LEN];
		char szUpdate[QUERY_MAX_LEN];

		int iLen = snprintf(szColumns, sizeof(szColumns), "id, owner_id, windows, pos, count, vnum");

		int iValueLen = snprintf(szValues, sizeof(szValues), "%u, %u, %d, %d, %u, %u",
				p->id, p->owner, p->window, p->pos, p->count, p->vnum);

		int iUpdateLen = snprintf(szUpdate, sizeof(szUpdate), "owner_id=%u, windows=%d, pos=%d, count=%u, vnum=%u",
				p->owner, p->window, p->pos, p->count, p->vnum);

 

Edited by arves100
Cache.cpp
  • Like 4
  • Thanks 4

Share this post


Link to post
Share on other sites

Hello i update mysql connector to MariaDB Connector v3.3

what is The advantages or the benefit of this sorry I do not understand precisely because I do not speak English fluently

4 hours ago, arves100 said:

UPDATE: Check out the "update" part to fix "Save item" problem.

 

 

Share this post


Link to post
Share on other sites
13 minutes ago, kingshero said:

Hello i update mysql connector to MariaDB Connector v3.3

what is The advantages or the benefit of this sorry I do not understand precisely because I do not speak English fluently

 

Nothing really change a lot, only that it have 100% MariaDB support, the MySQL Connector gave to me a bug when using MariaDB

Share this post


Link to post
Share on other sites
21 minutes ago, arves100 said:

Nothing really change a lot, only that it have 100% MariaDB support, the MySQL Connector gave to me a bug when using MariaDB

plz add example what the new style 

what the change when add mariaDb 

"REPLACE INTO item%s (id, owner_id, windows, pos, count, vnum, socket0, socket1, socket2, "
			"attrtype0, attrvalue0, "
			"attrtype1, attrvalue1, "
			"attrtype2, attrvalue2, "
			"attrtype3, attrvalue3, "
			"attrtype4, attrvalue4, "
			"attrtype5, attrvalue5, "
			"attrtype6, attrvalue6 "
			") "

Share this post


Link to post
Share on other sites
14 minutes ago, kingshero said:

plz add example what the new style 

what the change when add mariaDb 


"REPLACE INTO item%s (id, owner_id, windows, pos, count, vnum, socket0, socket1, socket2, "
			"attrtype0, attrvalue0, "
			"attrtype1, attrvalue1, "
			"attrtype2, attrvalue2, "
			"attrtype3, attrvalue3, "
			"attrtype4, attrvalue4, "
			"attrtype5, attrvalue5, "
			"attrtype6, attrvalue6 "
			") "

This query is ok

Share this post


Link to post
Share on other sites

to install mariaDb on freebsd you need deinstall mysql

on this example i use mysql57

you should use this command to delete the mysql57

cd /usr/ports/databases/mysql57-server/ && make deinstall clean
cd /usr/ports/databases/mysql57-client/ && make deinstall clean

 

now to install maraiadb 

you can use this command with the replace version

i use maraiadb 10,0

cd /usr/ports/databases/mariadb100-server && make install clean

enable ssl

after install use this :

echo 'mysql_enable="YES"' >> /etc/rc.conf

configuration 

MariaDB respects FreeBSD layout of file systems (and doesn’t check /etc and /etc/mysql for my.cnf. You will find the following default config files:

ls -l /usr/local/share/mysql/my*.cnf

/usr/local/share/mysql/my-huge.cnf
/usr/local/share/mysql/my-innodb-heavy-4G.cnf
/usr/local/share/mysql/my-large.cnf
/usr/local/share/mysql/my-medium.cnf
/usr/local/share/mysql/my-small.cnf

i use medium conf

cp /usr/local/share/mysql/my-medium.cnf /usr/local/etc/my.cnf

service mysql-server start

and done !

 

Share this post


Link to post
Share on other sites
12 hours ago, kingshero said:

to install mariaDb on freebsd you need deinstall mysql

on this example i use mysql57

you should use this command to delete the mysql57

cd /usr/ports/databases/mysql57-server/ && make deinstall clean
cd /usr/ports/databases/mysql57-client/ && make deinstall clean

 

now to install maraiadb 

you can use this command with the replace version

i use maraiadb 10,0

cd /usr/ports/databases/mariadb100-server && make install clean

enable ssl

after install use this :


echo 'mysql_enable="YES"' >> /etc/rc.conf

configuration 

MariaDB respects FreeBSD layout of file systems (and doesn’t check /etc and /etc/mysql for my.cnf. You will find the following default config files:

ls -l /usr/local/share/mysql/my*.cnf


/usr/local/share/mysql/my-huge.cnf
/usr/local/share/mysql/my-innodb-heavy-4G.cnf
/usr/local/share/mysql/my-large.cnf
/usr/local/share/mysql/my-medium.cnf
/usr/local/share/mysql/my-small.cnf

i use medium conf

cp /usr/local/share/mysql/my-medium.cnf /usr/local/etc/my.cnf

service mysql-server start

and done !

 

Keep in mind that the lateset version of MariaDB (FreeBSD 11.1 x64) is mariadb103 (100 for FreeBSd 11.1 x86). Also, mariadb dosen't load from /usr/local/etc/my.cnf anymore, they load my.cnf from /var/db/mysql.

13 hours ago, kingshero said:

when install mariaDb the style query not change ?

 

Only thing that change is the "window" keyword because it's reserved, otherwise it's the same

Share this post


Link to post
Share on other sites

Instead of changing window to windows, you can simply change it to `window`. (this little change is present on mysql8.0 as well)

Including <mariadb>'s includes isn't 100% required (at must, it's suggested to do so) since the <mysql>'s ones are also added when installing mariadb.

Instead of directly adding the mariadb define in CFLAGS, you can perform a check like mysql --version | grep -c MariaDB.

By default, when linking mariadb, several other dynamic .so are included in the game. (it may be annoying)

Share this post


Link to post
Share on other sites
8 hours ago, martysama0134 said:

Instead of changing window to windows, you can simply change it to `window`. (this little change is present on mysql8.0 as well)

Including <mariadb>'s includes isn't 100% required (at must, it's suggested to do so) since the <mysql>'s ones are also added when installing mariadb.

Instead of directly adding the mariadb define in CFLAGS, you can perform a check like mysql --version | grep -c MariaDB.

By default, when linking mariadb, several other dynamic .so are included in the game. (it may be annoying)

hello marty i have this problem when open use sh start.sh

i include the python code in my cpp code

Shared object "libpython2.7.so.1" not found, required by "game"

and when add this lib in lib32 in my game server i have problem in comparability 

Share this post


Link to post
Share on other sites
18 hours ago, arves100 said:

UPDATE: Cache.cpp

hello arves

we need edit mysql_query function in lua 

and make his compatibly  with mariadb10.2

Quote

mysql_query = function(query) 
    local rt = io.open('CONFIG','r'):read('*all') 
    local pre= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4') 
    math.randomseed(os.time()) 
    local fi,t,out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{} 
    os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi)   
    for av in io.open(fi,'r'):lines() do table.insert(t,split(av,'\t')) end; os.remove(fi); 
    for i = 2, table.getn(t) do table.foreach(t,function(a,b) 
        out[i-1]        = out[i-1] or {} 
        out[i-1][a]        = b 
        out[t[1][a]]    = out[t[1][a]] or {} 
        out[t[1][a]][i-1]    = b 
    end) end 
    return out 
end

 

Quote

mysql_query = function(query)
    math.randomseed(os.time())
    local fi,t,out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{}
    os.execute('mysql --login-path=local -e'..string.format('%q',query)..' > '..fi)
    for av in io.open(fi,'r'):lines() do table.insert(t,split(av,'\t')) end; os.remove(fi);
    for i = 2, table.getn(t) do
        table.foreach(t,function(a,b)
        out[i-1]               = out[i-1] or {}
        out[i-1][a]            = tonumber(b) or b or 'NULL'
        out[t[1][a]]           = out[t[1][a]] or {}
        out[t[1][a]][i-1]      = tonumber(b) or b or 'NULL'
        end)
    end
    out.__lines = t[1]
    return out
end

 

Share this post


Link to post
Share on other sites
On 2/8/2018 at 12:33 AM, arves100 said:

This query is ok

i have this error when game link 

Spoiler

/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_change_user':
mariadb_lib.c:(.text+0xbd7): undefined reference to `__strdup'
mariadb_lib.c:(.text+0xbe5): undefined reference to `__strdup'
mariadb_lib.c:(.text+0xc5d): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `my_set_error':
mariadb_lib.c:(.text+0x10bd): undefined reference to `__vsnprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_real_connect':
mariadb_lib.c:(.text+0x1f1c): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_optionsv':
mariadb_lib.c:(.text+0x2951): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x2a13): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x2a60): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x2ab0): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o):mariadb_lib.c:(.text+0x2b61): more undefined references to `__strdup' follow
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `ma_net_safe_read':
mariadb_lib.c:(.text+0x3f55): undefined reference to `__errno_location'
mariadb_lib.c:(.text+0x400f): undefined reference to `__strcpy_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mthd_my_read_one_row':
mariadb_lib.c:(.text+0x41f2): undefined reference to `__strcpy_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_select_db':
mariadb_lib.c:(.text+0x46a2): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mthd_my_real_connect':
mariadb_lib.c:(.text+0x4a01): undefined reference to `__snprintf_chk'
mariadb_lib.c:(.text+0x4bd0): undefined reference to `__sprintf_chk'
mariadb_lib.c:(.text+0x4ccb): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x4cea): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x4d04): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x4d1e): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x4d40): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o):mariadb_lib.c:(.text+0x4d94): more undefined references to `__strdup' follow
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mthd_my_real_connect':
mariadb_lib.c:(.text+0x5112): undefined reference to `__errno_location'
mariadb_lib.c:(.text+0x5225): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x530d): undefined reference to `__sprintf_chk'
mariadb_lib.c:(.text+0x54e0): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_list_dbs':
mariadb_lib.c:(.text+0x55aa): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_list_tables':
mariadb_lib.c:(.text+0x565a): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_set_character_set':
mariadb_lib.c:(.text+0x57db): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_list_fields':
mariadb_lib.c:(.text+0x628e): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mthd_my_read_query_result':
mariadb_lib.c:(.text+0x75ea): undefined reference to `__memcpy_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_pvio.c.o): In function `ma_pvio_read':
ma_pvio.c:(.text+0x5f7): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_pvio.c.o): In function `ma_pvio_write':
ma_pvio.c:(.text+0x8ba): undefined reference to `__errno_location'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_password.c.o): In function `ma_make_scrambled_password':
ma_password.c:(.text+0x312): undefined reference to `__sprintf_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_stmt.c.o): In function `stmt_set_error':
mariadb_stmt.c:(.text+0x7b3): undefined reference to `__vsnprintf_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_loaddata.c.o): In function `mysql_local_infile_read':
ma_loaddata.c:(.text+0xf9): undefined reference to `__errno_location'
ma_loaddata.c:(.text+0x13c): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_loaddata.c.o): In function `mysql_local_infile_init':
ma_loaddata.c:(.text+0x1d8): undefined reference to `__errno_location'
ma_loaddata.c:(.text+0x215): undefined reference to `__snprintf_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_stmt_codec.c.o): In function `my_atoll':
ma_stmt_codec.c:(.text+0x6c): undefined reference to `__memcpy_chk'
ma_stmt_codec.c:(.text+0x76): undefined reference to `__errno_location'
ma_stmt_codec.c:(.text+0xcc): undefined reference to `__ctype_b_loc'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_stmt_codec.c.o): In function `my_atod':
ma_stmt_codec.c:(.text+0x45d): undefined reference to `__memcpy_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_stmt_codec.c.o): In function `.L187':
ma_stmt_codec.c:(.text+0xcc0): undefined reference to `__sprintf_chk'
ma_stmt_codec.c:(.text+0xd0f): undefined reference to `__sprintf_chk'
ma_stmt_codec.c:(.text+0xd98): undefined reference to `__strcat_chk'
ma_stmt_codec.c:(.text+0xde6): undefined reference to `__sprintf_chk'
ma_stmt_codec.c:(.text+0xe7a): undefined reference to `__sprintf_chk'
ma_stmt_codec.c:(.text+0xec9): undefined reference to `__sprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_stmt_codec.c.o): In function `.L266':
ma_stmt_codec.c:(.text+0x123c): undefined reference to `__memset_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_stmt_codec.c.o): In function `.L315':
ma_stmt_codec.c:(.text+0x1724): undefined reference to `__memset_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_client_plugin.c.o): In function `mysql_load_plugin_v':
ma_client_plugin.c:(.text+0x552): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_client_plugin.c.o): In function `mysql_client_plugin_init':
ma_client_plugin.c:(.text+0x851): undefined reference to `__strdup'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(openssl.c.o): In function `ma_tls_set_error':
openssl.c:(.text+0x106): undefined reference to `__snprintf_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_async.c.o): In function `my_connect_async':
mariadb_async.c:(.text+0xa6b): undefined reference to `__errno_location'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(pvio_socket.c.o): In function `pvio_socket_wait_io_or_timeout':
pvio_socket.c:(.text+0x3e9): undefined reference to `__errno_location'
pvio_socket.c:(.text+0x412): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(pvio_socket.c.o): In function `pvio_socket_blocking':
pvio_socket.c:(.text+0x4e1): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(pvio_socket.c.o): In function `pvio_socket_connect_sync_or_async':
pvio_socket.c:(.text+0x611): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(pvio_socket.c.o):pvio_socket.c:(.text+0x769): more undefined references to `__errno_location' follow
../../../Extern/lib/mariadb/libmariadbclient.a(pvio_socket.c.o): In function `pvio_socket_connect':
pvio_socket.c:(.text+0xbfe): undefined reference to `__strcpy_chk'
pvio_socket.c:(.text+0xc24): undefined reference to `__errno_location'
pvio_socket.c:(.text+0xce8): undefined reference to `__errno_location'
pvio_socket.c:(.text+0xdaf): undefined reference to `__snprintf_chk'
pvio_socket.c:(.text+0x1005): undefined reference to `__errno_location'
pvio_socket.c:(.text+0x119a): undefined reference to `__errno_location'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(my_auth.c.o): In function `client_mpvio_write_packet':
my_auth.c:(.text+0x300): undefined reference to `__errno_location'
my_auth.c:(.text+0x674): undefined reference to `__errno_location'
my_auth.c:(.text+0x7f2): undefined reference to `__strdup'
my_auth.c:(.text+0x8eb): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(my_auth.c.o): In function `run_plugin_auth':
my_auth.c:(.text+0xda6): undefined reference to `__errno_location'
my_auth.c:(.text+0xe6b): undefined reference to `__errno_location'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_charset.c.o): In function `map_charset_name.constprop.6':
ma_charset.c:(.text+0x82f): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_charset.c.o): In function `mariadb_convert_string':
ma_charset.c:(.text+0xd31): undefined reference to `iconv_open'
ma_charset.c:(.text+0xd5c): undefined reference to `iconv'
ma_charset.c:(.text+0xd74): undefined reference to `iconv_close'
ma_charset.c:(.text+0xd82): undefined reference to `__errno_location'
ma_charset.c:(.text+0xd99): undefined reference to `__errno_location'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_hash.c.o): In function `calc_hashnr_caseup':
ma_hash.c:(.text+0x6b): undefined reference to `__ctype_toupper_loc'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_default.c.o): In function `add_cfg_dir':
ma_default.c:(.text+0x34): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_default.c.o): In function `_mariadb_read_options_from_file':
ma_default.c:(.text+0x135): undefined reference to `__ctype_b_loc'
ma_default.c:(.text+0x201): undefined reference to `__rawmemchr'
ma_default.c:(.text+0x46c): undefined reference to `__rawmemchr'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_default.c.o): In function `_mariadb_read_options':
ma_default.c:(.text+0x669): undefined reference to `__snprintf_chk'
ma_default.c:(.text+0x6db): undefined reference to `__snprintf_chk'
gmake: *** [../game_r41239] Error 1

 

this is make file 

Spoiler

CC = g++

GAME_VERSION = $(shell cat ../../__REVISION__)

INCDIR =
LIBDIR =
BINDIR = ..
OBJDIR = .obj
$(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)

## LIST OF CONSTANTS BEGIN
ENABLE_GOOGLE_TEST = 0
ENABLE_HSHIELD_SYSTEM = 0
ENABLE_XTRAP_SYSTEM = 0
ENABLE_LUA_5_2_VERSION = 0
ENABLE_GCC_AUTODEPEND = 1
ENABLE_NEWSTUFF_EX = 0
ENABLE_MRIADB = 1
## LIST OF CONSTANTS END

# Depend Path File
ifneq ($(ENABLE_GCC_AUTODEPEND), 1)
DEPFILE = Depend
endif

# Standard Libraries
LIBS = -lm -lmd

# Project Flags
CFLAGS = -m32 -g -Wall -O2 -pipe -fexceptions -fno-strict-aliasing -pthread -D_THREAD_SAFE -DNDEBUG -D__MARIADB__
# CFLAGS = -m32 -g3 -Wall -O0 -pipe -fexceptions -fno-rtti -fno-strict-aliasing -Wno-unused-local-typedefs -Wno-long-long -pthread -D_THREAD_SAFE -DNDEBUG

# FreeBSD stack protector
CFLAGS += -fstack-protector-all

# Version defines
CFLAGS += -D__USER__=\"$(USER)\" -D__HOSTNAME__=\"$(HOSTNAME)\" -D__PWD__=\"$(PWD)\" -D__GAME_VERSION__=\"$(GAME_VERSION)\"

# Boost
INCDIR += -I../../../Extern/include/boost

# DevIL
INCDIR += -I../../../Extern/include/IL
LIBS += ../../../Extern/lib/libIL.a\
        ../../../Extern/lib/libjasper.a\
        ../../../Extern/lib/libpng.a\
        ../../../Extern/lib/libtiff.a\
        ../../../Extern/lib/libjbig.a\
        ../../../Extern/lib/libmng.a\
        /usr/lib/liblzma.a\
        ../../../Extern/lib/liblcms.a\
        ../../../Extern/lib/libjpeg.a
ifeq ($(ENABLE_MRIADB_HAIES), 1)
INCDIR += -I../../../Extern/include/mariadb
LIBS += ../../../Extern/lib/mariadb/libmariadbclient.a /usr/lib/libz.a -lcrypto
else
# MySQL
INCDIR += -I/usr/local/include/mysql
LIBS += /usr/local/lib/mysql/libmysqlclient.a /usr/lib/libz.a
endif
# CryptoPP
LIBS += ../../../Extern/lib/libcryptopp.a

# GTest
ifeq ($(ENABLE_GOOGLE_TEST), 1)
LIBS += /usr/local/lib/libgtest.a
CFLAGS += -DENABLE_GOOGLE_TEST
endif

# HackShield
ifeq ($(ENABLE_HSHIELD_SYSTEM), 1)
INCDIR += -I../../libhackshield/include
CFLAGS += -DENABLE_HSHIELD_SYSTEM
endif

# XTrap
ifeq ($(ENABLE_XTRAP_SYSTEM), 1)
INCDIR += -I../../libxtrap/include
CFLAGS += -DENABLE_XTRAP_SYSTEM
endif

# OpenSSL
INCDIR += -I/usr/include
LIBS += -lssl
# LIBS += /usr/lib/libssl.a /usr/lib/libssh_p.a

# Lua
CFLAGS += -DENABLE_LUA_5_2_VERSION=ENABLE_LUA_5_2_VERSION
ifeq ($(ENABLE_LUA_5_2_VERSION), 1)
INCDIR += -I../../liblua/.lua52/install/include
LIBDIR += -L../../liblua/.lua52/install/lib
LIBS += ../../liblua/.lua52/install/lib/liblua.a
# LIBS += ../../liblua/.lua52/src/liblua.a
else
INCDIR += -I../../liblua/.lua50/include
LIBDIR += -L../../liblua/.lua50/lib
LIBS += ../../liblua/.lua50/lib/liblua.a ../../liblua/.lua50/lib/liblualib.a
endif

# Project Libraries
INCDIR += -I../../../Extern/include
INCDIR += -I/usr/local/include
LIBDIR += -L/usr/local/lib
#LIBDIR += /usr/lib32/libpython2.7.so

INCDIR += -I../../libserverkey
LIBDIR += -L../../libthecore/lib -L../../libpoly -L../../libsql -L../../libgame/lib -L../../libserverkey
LIBS += -lthecore -lpoly -lsql -lgame -lserverkey

# PROJECT_SRC_FILES BEGIN
MAINCPP = main.cpp
TESTCPP = test.cpp

CFILE    = minilzo.c

CPPFILE = BattleArena.cpp FSM.cpp MarkConvert.cpp MarkImage.cpp MarkManager.cpp OXEvent.cpp TrafficProfiler.cpp ani.cpp attr_transfer.cpp\
          arena.cpp\
          banword.cpp battle.cpp blend_item.cpp block_country.cpp buffer_manager.cpp building.cpp castle.cpp\
          char.cpp char_affect.cpp char_battle.cpp char_change_empire.cpp char_horse.cpp char_item.cpp char_manager.cpp\
          char_quickslot.cpp char_resist.cpp char_skill.cpp char_state.cpp PetSystem.cpp cmd.cpp cmd_emotion.cpp cmd_general.cpp\
          cmd_gm.cpp cmd_oxevent.cpp config.cpp constants.cpp crc32.cpp cube.cpp db.cpp desc.cpp\
          desc_client.cpp desc_manager.cpp desc_p2p.cpp dev_log.cpp dungeon.cpp empire_text_convert.cpp entity.cpp\
          entity_view.cpp event.cpp event_queue.cpp exchange.cpp file_loader.cpp fishing.cpp gm.cpp guild.cpp\
          guild_manager.cpp guild_war.cpp horse_rider.cpp horsename_manager.cpp input.cpp input_auth.cpp input_db.cpp\
          input_login.cpp input_main.cpp input_p2p.cpp input_teen.cpp input_udp.cpp ip_ban.cpp\
          item.cpp item_addon.cpp item_attribute.cpp item_manager.cpp item_manager_idrange.cpp locale.cpp\
          locale_service.cpp log.cpp login_data.cpp lzo_manager.cpp marriage.cpp matrix_card.cpp\
          messenger_manager.cpp mining.cpp mob_manager.cpp monarch.cpp motion.cpp over9refine.cpp p2p.cpp packet_info.cpp\
          party.cpp passpod.cpp pcbang.cpp polymorph.cpp priv_manager.cpp pvp.cpp\
          questevent.cpp questlua.cpp questlua_affect.cpp questlua_arena.cpp questlua_ba.cpp questlua_building.cpp\
          questlua_danceevent.cpp questlua_dungeon.cpp questlua_forked.cpp questlua_game.cpp questlua_global.cpp\
          questlua_guild.cpp questlua_horse.cpp questlua_pet.cpp questlua_item.cpp questlua_marriage.cpp questlua_mgmt.cpp\
          questlua_monarch.cpp questlua_npc.cpp questlua_oxevent.cpp questlua_party.cpp questlua_pc.cpp\
          questlua_quest.cpp questlua_target.cpp questmanager.cpp questnpc.cpp questpc.cpp\
          questlua_arena_party_haies.cpp\
          refine.cpp regen.cpp safebox.cpp sectree.cpp sectree_manager.cpp sequence.cpp shop.cpp\
          skill.cpp start_position.cpp target.cpp text_file_loader.cpp trigger.cpp utils.cpp vector.cpp war_map.cpp\
          wedding.cpp xmas_event.cpp version.cpp panama.cpp threeway_war.cpp map_location.cpp auth_brazil.cpp\
          BlueDragon.cpp BlueDragon_Binder.cpp DragonLair.cpp questlua_dragonlair.cpp\
          HackShield.cpp HackShield_Impl.cpp char_hackshield.cpp skill_power.cpp affect.cpp\
          SpeedServer.cpp questlua_speedserver.cpp XTrapManager.cpp\
          auction_manager.cpp FileMonitor_FreeBSD.cpp ClientPackageCryptInfo.cpp cipher.cpp\
          buff_on_attributes.cpp dragon_soul_table.cpp DragonSoul.cpp\
          group_text_parse_tree.cpp char_dragonsoul.cpp questlua_dragonsoul.cpp\
          shop_manager.cpp shopEx.cpp item_manager_read_tables.cpp\
          New_PetSystem.cpp questlua_petnew.cpp\
          shutdown_manager.cpp char_cards.cpp offline_shop.cpp\
          offlineshop_manager.cpp offlineshop_config.cpp vid.cpp

ifeq ($(ENABLE_NEWSTUFF_EX), 1)
CPPFILE += questlua_new.cpp\
            questlua_new_constant.cpp\
            questlua_new_desc.cpp\
            questlua_new_item.cpp\
            questlua_new_npc.cpp\
            questlua_new_pc.cpp\
            questlua_new_quest.cpp\
            questlua_new_test.cpp
CFLAGS += -DENABLE_NEWSTUFF_EX=ENABLE_NEWSTUFF_EX
endif
# PROJECT_SRC_FILES END

# PROJECT_OBJ_FILES BEGIN
COBJS    = $(CFILE:%.c=$(OBJDIR)/%.o)
CPPOBJS    = $(CPPFILE:%.cpp=$(OBJDIR)/%.o)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
CDEPS    = $(COBJS:%.o=%.d)
CPPDEPS    = $(CPPOBJS:%.o=%.d)
endif

MAINOBJ = $(MAINCPP:%.cpp=$(OBJDIR)/%.o)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
MAINDEPS = $(MAINOBJ:%.o=%.d)
endif

TESTOBJ = $(TESTCPP:%.cpp=$(OBJDIR)/%.o)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
TESTDEPS = $(TESTOBJ:%.o=%.d)
endif
# PROJECT_OBJ_FILES END

# Target Paths
MAIN_TARGET = $(BINDIR)/game_r$(GAME_VERSION)
TEST_TARGET = $(BINDIR)/game_r$(GAME_VERSION)_test

# previously -> default: $(MAIN_TARGET) $(TEST_TARGET)
default: $(MAIN_TARGET)
test: $(TEST_TARGET)

$(OBJDIR)/%.o: %.c
    @echo compiling $<
    @$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @$(CC) -MM -MG -MP $(CFLAGS) $(INCDIR) -c $< -o $(OBJDIR)/$*.d
    @sed -i '' -e's/$*.o:/$(OBJDIR)\/$*.o:/g' $(OBJDIR)/$*.d
endif

$(OBJDIR)/%.o: %.cpp
    @echo compiling $<
    @$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @$(CC) -MM -MG -MP $(CFLAGS) $(INCDIR) -c $< -o $(OBJDIR)/$*.d
    @sed -i '' -e's/$*.o:/$(OBJDIR)\/$*.o:/g' $(OBJDIR)/$*.d
endif

limit_time:
    @echo update limit time
    @python update_limit_time.py

$(MAIN_TARGET): $(CPPOBJS) $(COBJS) $(MAINOBJ)
    @echo linking $(MAIN_TARGET)
    @$(CC) $(CFLAGS) $(LIBDIR) $(COBJS) $(CPPOBJS) $(MAINOBJ) $(LIBS) -o $(MAIN_TARGET)

$(TEST_TARGET): $(TESTCPP) $(CPPOBJS) $(COBJS) $(TESTOBJ)
    @echo linking $(TEST_TARGET)
    @$(CC) $(CFLAGS) $(LIBDIR) $(COBJS) $(CPPOBJS) $(TESTOBJ) $(LIBS) -o $(TEST_TARGET)

dump:
    @$(CC) -dM -E - < /dev/null > .nope.nope

symlink:
    @ln -fs game_r$(GAME_VERSION) $(BINDIR)/game_symlink

strip:
    @cp $(BINDIR)/game_r$(GAME_VERSION) $(BINDIR)/game_r
    @strip $(BINDIR)/game_r

clean:
    @rm -f $(COBJS) $(CPPOBJS) $(MAINOBJ) $(TESTOBJ)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @rm -f $(CDEPS) $(CPPDEPS) $(MAINDEPS) $(TESTDEPS)
endif
    @rm -f $(BINDIR)/game_r* $(BINDIR)/conv

cc-ver:
    @$(CC) -v

tag:
    ctags *.cpp *.h *.c

dep:
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @echo "Note: gcc autodepend is autodetected, so target dep skipped"
else
    makedepend -f $(DEPFILE) $(INCDIR) -I/usr/include/c++/3.3 -I/usr/include/c++/4.2 -p$(OBJDIR)/ $(CPPFILE) $(CFILE) $(MAINCPP) $(TESTCPP) 2> /dev/null > $(DEPFILE)
endif

# AUTO_DEPEND_CHECK BEGIN
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
sinclude $(CDEPS)
sinclude $(CPPDEPS)
sinclude $(MAINDEPS)
sinclude $(TESTDEPS)
else
sinclude $(DEPFILE)
endif
# AUTO_DEPEND_CHECK END
 

 

Share this post


Link to post
Share on other sites
On 13/3/2018 at 3:31 AM, kingshero said:

i have this error when game link 

  Hide contents

/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_change_user':
mariadb_lib.c:(.text+0xbd7): undefined reference to `__strdup'
mariadb_lib.c:(.text+0xbe5): undefined reference to `__strdup'
mariadb_lib.c:(.text+0xc5d): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `my_set_error':
mariadb_lib.c:(.text+0x10bd): undefined reference to `__vsnprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_real_connect':
mariadb_lib.c:(.text+0x1f1c): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_optionsv':
mariadb_lib.c:(.text+0x2951): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x2a13): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x2a60): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x2ab0): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o):mariadb_lib.c:(.text+0x2b61): more undefined references to `__strdup' follow
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `ma_net_safe_read':
mariadb_lib.c:(.text+0x3f55): undefined reference to `__errno_location'
mariadb_lib.c:(.text+0x400f): undefined reference to `__strcpy_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mthd_my_read_one_row':
mariadb_lib.c:(.text+0x41f2): undefined reference to `__strcpy_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_select_db':
mariadb_lib.c:(.text+0x46a2): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mthd_my_real_connect':
mariadb_lib.c:(.text+0x4a01): undefined reference to `__snprintf_chk'
mariadb_lib.c:(.text+0x4bd0): undefined reference to `__sprintf_chk'
mariadb_lib.c:(.text+0x4ccb): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x4cea): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x4d04): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x4d1e): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x4d40): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o):mariadb_lib.c:(.text+0x4d94): more undefined references to `__strdup' follow
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mthd_my_real_connect':
mariadb_lib.c:(.text+0x5112): undefined reference to `__errno_location'
mariadb_lib.c:(.text+0x5225): undefined reference to `__strdup'
mariadb_lib.c:(.text+0x530d): undefined reference to `__sprintf_chk'
mariadb_lib.c:(.text+0x54e0): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_list_dbs':
mariadb_lib.c:(.text+0x55aa): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_list_tables':
mariadb_lib.c:(.text+0x565a): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_set_character_set':
mariadb_lib.c:(.text+0x57db): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mysql_list_fields':
mariadb_lib.c:(.text+0x628e): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_lib.c.o): In function `mthd_my_read_query_result':
mariadb_lib.c:(.text+0x75ea): undefined reference to `__memcpy_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_pvio.c.o): In function `ma_pvio_read':
ma_pvio.c:(.text+0x5f7): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_pvio.c.o): In function `ma_pvio_write':
ma_pvio.c:(.text+0x8ba): undefined reference to `__errno_location'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_password.c.o): In function `ma_make_scrambled_password':
ma_password.c:(.text+0x312): undefined reference to `__sprintf_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_stmt.c.o): In function `stmt_set_error':
mariadb_stmt.c:(.text+0x7b3): undefined reference to `__vsnprintf_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_loaddata.c.o): In function `mysql_local_infile_read':
ma_loaddata.c:(.text+0xf9): undefined reference to `__errno_location'
ma_loaddata.c:(.text+0x13c): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_loaddata.c.o): In function `mysql_local_infile_init':
ma_loaddata.c:(.text+0x1d8): undefined reference to `__errno_location'
ma_loaddata.c:(.text+0x215): undefined reference to `__snprintf_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_stmt_codec.c.o): In function `my_atoll':
ma_stmt_codec.c:(.text+0x6c): undefined reference to `__memcpy_chk'
ma_stmt_codec.c:(.text+0x76): undefined reference to `__errno_location'
ma_stmt_codec.c:(.text+0xcc): undefined reference to `__ctype_b_loc'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_stmt_codec.c.o): In function `my_atod':
ma_stmt_codec.c:(.text+0x45d): undefined reference to `__memcpy_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_stmt_codec.c.o): In function `.L187':
ma_stmt_codec.c:(.text+0xcc0): undefined reference to `__sprintf_chk'
ma_stmt_codec.c:(.text+0xd0f): undefined reference to `__sprintf_chk'
ma_stmt_codec.c:(.text+0xd98): undefined reference to `__strcat_chk'
ma_stmt_codec.c:(.text+0xde6): undefined reference to `__sprintf_chk'
ma_stmt_codec.c:(.text+0xe7a): undefined reference to `__sprintf_chk'
ma_stmt_codec.c:(.text+0xec9): undefined reference to `__sprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_stmt_codec.c.o): In function `.L266':
ma_stmt_codec.c:(.text+0x123c): undefined reference to `__memset_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_stmt_codec.c.o): In function `.L315':
ma_stmt_codec.c:(.text+0x1724): undefined reference to `__memset_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_client_plugin.c.o): In function `mysql_load_plugin_v':
ma_client_plugin.c:(.text+0x552): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_client_plugin.c.o): In function `mysql_client_plugin_init':
ma_client_plugin.c:(.text+0x851): undefined reference to `__strdup'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(openssl.c.o): In function `ma_tls_set_error':
openssl.c:(.text+0x106): undefined reference to `__snprintf_chk'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(mariadb_async.c.o): In function `my_connect_async':
mariadb_async.c:(.text+0xa6b): undefined reference to `__errno_location'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(pvio_socket.c.o): In function `pvio_socket_wait_io_or_timeout':
pvio_socket.c:(.text+0x3e9): undefined reference to `__errno_location'
pvio_socket.c:(.text+0x412): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(pvio_socket.c.o): In function `pvio_socket_blocking':
pvio_socket.c:(.text+0x4e1): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(pvio_socket.c.o): In function `pvio_socket_connect_sync_or_async':
pvio_socket.c:(.text+0x611): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(pvio_socket.c.o):pvio_socket.c:(.text+0x769): more undefined references to `__errno_location' follow
../../../Extern/lib/mariadb/libmariadbclient.a(pvio_socket.c.o): In function `pvio_socket_connect':
pvio_socket.c:(.text+0xbfe): undefined reference to `__strcpy_chk'
pvio_socket.c:(.text+0xc24): undefined reference to `__errno_location'
pvio_socket.c:(.text+0xce8): undefined reference to `__errno_location'
pvio_socket.c:(.text+0xdaf): undefined reference to `__snprintf_chk'
pvio_socket.c:(.text+0x1005): undefined reference to `__errno_location'
pvio_socket.c:(.text+0x119a): undefined reference to `__errno_location'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(my_auth.c.o): In function `client_mpvio_write_packet':
my_auth.c:(.text+0x300): undefined reference to `__errno_location'
my_auth.c:(.text+0x674): undefined reference to `__errno_location'
my_auth.c:(.text+0x7f2): undefined reference to `__strdup'
my_auth.c:(.text+0x8eb): undefined reference to `__errno_location'
../../../Extern/lib/mariadb/libmariadbclient.a(my_auth.c.o): In function `run_plugin_auth':
my_auth.c:(.text+0xda6): undefined reference to `__errno_location'
my_auth.c:(.text+0xe6b): undefined reference to `__errno_location'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_charset.c.o): In function `map_charset_name.constprop.6':
ma_charset.c:(.text+0x82f): undefined reference to `__snprintf_chk'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_charset.c.o): In function `mariadb_convert_string':
ma_charset.c:(.text+0xd31): undefined reference to `iconv_open'
ma_charset.c:(.text+0xd5c): undefined reference to `iconv'
ma_charset.c:(.text+0xd74): undefined reference to `iconv_close'
ma_charset.c:(.text+0xd82): undefined reference to `__errno_location'
ma_charset.c:(.text+0xd99): undefined reference to `__errno_location'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_hash.c.o): In function `calc_hashnr_caseup':
ma_hash.c:(.text+0x6b): undefined reference to `__ctype_toupper_loc'
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
../../../Extern/lib/mariadb/libmariadbclient.a(ma_default.c.o): In function `add_cfg_dir':
ma_default.c:(.text+0x34): undefined reference to `__strdup'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_default.c.o): In function `_mariadb_read_options_from_file':
ma_default.c:(.text+0x135): undefined reference to `__ctype_b_loc'
ma_default.c:(.text+0x201): undefined reference to `__rawmemchr'
ma_default.c:(.text+0x46c): undefined reference to `__rawmemchr'
../../../Extern/lib/mariadb/libmariadbclient.a(ma_default.c.o): In function `_mariadb_read_options':
ma_default.c:(.text+0x669): undefined reference to `__snprintf_chk'
ma_default.c:(.text+0x6db): undefined reference to `__snprintf_chk'
gmake: *** [../game_r41239] Error 1

 

this is make file 

  Reveal hidden contents

CC = g++

GAME_VERSION = $(shell cat ../../__REVISION__)

INCDIR =
LIBDIR =
BINDIR = ..
OBJDIR = .obj
$(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)

## LIST OF CONSTANTS BEGIN
ENABLE_GOOGLE_TEST = 0
ENABLE_HSHIELD_SYSTEM = 0
ENABLE_XTRAP_SYSTEM = 0
ENABLE_LUA_5_2_VERSION = 0
ENABLE_GCC_AUTODEPEND = 1
ENABLE_NEWSTUFF_EX = 0
ENABLE_MRIADB = 1
## LIST OF CONSTANTS END

# Depend Path File
ifneq ($(ENABLE_GCC_AUTODEPEND), 1)
DEPFILE = Depend
endif

# Standard Libraries
LIBS = -lm -lmd

# Project Flags
CFLAGS = -m32 -g -Wall -O2 -pipe -fexceptions -fno-strict-aliasing -pthread -D_THREAD_SAFE -DNDEBUG -D__MARIADB__
# CFLAGS = -m32 -g3 -Wall -O0 -pipe -fexceptions -fno-rtti -fno-strict-aliasing -Wno-unused-local-typedefs -Wno-long-long -pthread -D_THREAD_SAFE -DNDEBUG

# FreeBSD stack protector
CFLAGS += -fstack-protector-all

# Version defines
CFLAGS += -D__USER__=\"$(USER)\" -D__HOSTNAME__=\"$(HOSTNAME)\" -D__PWD__=\"$(PWD)\" -D__GAME_VERSION__=\"$(GAME_VERSION)\"

# Boost
INCDIR += -I../../../Extern/include/boost

# DevIL
INCDIR += -I../../../Extern/include/IL
LIBS += ../../../Extern/lib/libIL.a\
        ../../../Extern/lib/libjasper.a\
        ../../../Extern/lib/libpng.a\
        ../../../Extern/lib/libtiff.a\
        ../../../Extern/lib/libjbig.a\
        ../../../Extern/lib/libmng.a\
        /usr/lib/liblzma.a\
        ../../../Extern/lib/liblcms.a\
        ../../../Extern/lib/libjpeg.a
ifeq ($(ENABLE_MRIADB_HAIES), 1)
INCDIR += -I../../../Extern/include/mariadb
LIBS += ../../../Extern/lib/mariadb/libmariadbclient.a /usr/lib/libz.a -lcrypto
else
# MySQL
INCDIR += -I/usr/local/include/mysql
LIBS += /usr/local/lib/mysql/libmysqlclient.a /usr/lib/libz.a
endif
# CryptoPP
LIBS += ../../../Extern/lib/libcryptopp.a

# GTest
ifeq ($(ENABLE_GOOGLE_TEST), 1)
LIBS += /usr/local/lib/libgtest.a
CFLAGS += -DENABLE_GOOGLE_TEST
endif

# HackShield
ifeq ($(ENABLE_HSHIELD_SYSTEM), 1)
INCDIR += -I../../libhackshield/include
CFLAGS += -DENABLE_HSHIELD_SYSTEM
endif

# XTrap
ifeq ($(ENABLE_XTRAP_SYSTEM), 1)
INCDIR += -I../../libxtrap/include
CFLAGS += -DENABLE_XTRAP_SYSTEM
endif

# OpenSSL
INCDIR += -I/usr/include
LIBS += -lssl
# LIBS += /usr/lib/libssl.a /usr/lib/libssh_p.a

# Lua
CFLAGS += -DENABLE_LUA_5_2_VERSION=ENABLE_LUA_5_2_VERSION
ifeq ($(ENABLE_LUA_5_2_VERSION), 1)
INCDIR += -I../../liblua/.lua52/install/include
LIBDIR += -L../../liblua/.lua52/install/lib
LIBS += ../../liblua/.lua52/install/lib/liblua.a
# LIBS += ../../liblua/.lua52/src/liblua.a
else
INCDIR += -I../../liblua/.lua50/include
LIBDIR += -L../../liblua/.lua50/lib
LIBS += ../../liblua/.lua50/lib/liblua.a ../../liblua/.lua50/lib/liblualib.a
endif

# Project Libraries
INCDIR += -I../../../Extern/include
INCDIR += -I/usr/local/include
LIBDIR += -L/usr/local/lib
#LIBDIR += /usr/lib32/libpython2.7.so

INCDIR += -I../../libserverkey
LIBDIR += -L../../libthecore/lib -L../../libpoly -L../../libsql -L../../libgame/lib -L../../libserverkey
LIBS += -lthecore -lpoly -lsql -lgame -lserverkey

# PROJECT_SRC_FILES BEGIN
MAINCPP = main.cpp
TESTCPP = test.cpp

CFILE    = minilzo.c

CPPFILE = BattleArena.cpp FSM.cpp MarkConvert.cpp MarkImage.cpp MarkManager.cpp OXEvent.cpp TrafficProfiler.cpp ani.cpp attr_transfer.cpp\
          arena.cpp\
          banword.cpp battle.cpp blend_item.cpp block_country.cpp buffer_manager.cpp building.cpp castle.cpp\
          char.cpp char_affect.cpp char_battle.cpp char_change_empire.cpp char_horse.cpp char_item.cpp char_manager.cpp\
          char_quickslot.cpp char_resist.cpp char_skill.cpp char_state.cpp PetSystem.cpp cmd.cpp cmd_emotion.cpp cmd_general.cpp\
          cmd_gm.cpp cmd_oxevent.cpp config.cpp constants.cpp crc32.cpp cube.cpp db.cpp desc.cpp\
          desc_client.cpp desc_manager.cpp desc_p2p.cpp dev_log.cpp dungeon.cpp empire_text_convert.cpp entity.cpp\
          entity_view.cpp event.cpp event_queue.cpp exchange.cpp file_loader.cpp fishing.cpp gm.cpp guild.cpp\
          guild_manager.cpp guild_war.cpp horse_rider.cpp horsename_manager.cpp input.cpp input_auth.cpp input_db.cpp\
          input_login.cpp input_main.cpp input_p2p.cpp input_teen.cpp input_udp.cpp ip_ban.cpp\
          item.cpp item_addon.cpp item_attribute.cpp item_manager.cpp item_manager_idrange.cpp locale.cpp\
          locale_service.cpp log.cpp login_data.cpp lzo_manager.cpp marriage.cpp matrix_card.cpp\
          messenger_manager.cpp mining.cpp mob_manager.cpp monarch.cpp motion.cpp over9refine.cpp p2p.cpp packet_info.cpp\
          party.cpp passpod.cpp pcbang.cpp polymorph.cpp priv_manager.cpp pvp.cpp\
          questevent.cpp questlua.cpp questlua_affect.cpp questlua_arena.cpp questlua_ba.cpp questlua_building.cpp\
          questlua_danceevent.cpp questlua_dungeon.cpp questlua_forked.cpp questlua_game.cpp questlua_global.cpp\
          questlua_guild.cpp questlua_horse.cpp questlua_pet.cpp questlua_item.cpp questlua_marriage.cpp questlua_mgmt.cpp\
          questlua_monarch.cpp questlua_npc.cpp questlua_oxevent.cpp questlua_party.cpp questlua_pc.cpp\
          questlua_quest.cpp questlua_target.cpp questmanager.cpp questnpc.cpp questpc.cpp\
          questlua_arena_party_haies.cpp\
          refine.cpp regen.cpp safebox.cpp sectree.cpp sectree_manager.cpp sequence.cpp shop.cpp\
          skill.cpp start_position.cpp target.cpp text_file_loader.cpp trigger.cpp utils.cpp vector.cpp war_map.cpp\
          wedding.cpp xmas_event.cpp version.cpp panama.cpp threeway_war.cpp map_location.cpp auth_brazil.cpp\
          BlueDragon.cpp BlueDragon_Binder.cpp DragonLair.cpp questlua_dragonlair.cpp\
          HackShield.cpp HackShield_Impl.cpp char_hackshield.cpp skill_power.cpp affect.cpp\
          SpeedServer.cpp questlua_speedserver.cpp XTrapManager.cpp\
          auction_manager.cpp FileMonitor_FreeBSD.cpp ClientPackageCryptInfo.cpp cipher.cpp\
          buff_on_attributes.cpp dragon_soul_table.cpp DragonSoul.cpp\
          group_text_parse_tree.cpp char_dragonsoul.cpp questlua_dragonsoul.cpp\
          shop_manager.cpp shopEx.cpp item_manager_read_tables.cpp\
          New_PetSystem.cpp questlua_petnew.cpp\
          shutdown_manager.cpp char_cards.cpp offline_shop.cpp\
          offlineshop_manager.cpp offlineshop_config.cpp vid.cpp

ifeq ($(ENABLE_NEWSTUFF_EX), 1)
CPPFILE += questlua_new.cpp\
            questlua_new_constant.cpp\
            questlua_new_desc.cpp\
            questlua_new_item.cpp\
            questlua_new_npc.cpp\
            questlua_new_pc.cpp\
            questlua_new_quest.cpp\
            questlua_new_test.cpp
CFLAGS += -DENABLE_NEWSTUFF_EX=ENABLE_NEWSTUFF_EX
endif
# PROJECT_SRC_FILES END

# PROJECT_OBJ_FILES BEGIN
COBJS    = $(CFILE:%.c=$(OBJDIR)/%.o)
CPPOBJS    = $(CPPFILE:%.cpp=$(OBJDIR)/%.o)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
CDEPS    = $(COBJS:%.o=%.d)
CPPDEPS    = $(CPPOBJS:%.o=%.d)
endif

MAINOBJ = $(MAINCPP:%.cpp=$(OBJDIR)/%.o)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
MAINDEPS = $(MAINOBJ:%.o=%.d)
endif

TESTOBJ = $(TESTCPP:%.cpp=$(OBJDIR)/%.o)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
TESTDEPS = $(TESTOBJ:%.o=%.d)
endif
# PROJECT_OBJ_FILES END

# Target Paths
MAIN_TARGET = $(BINDIR)/game_r$(GAME_VERSION)
TEST_TARGET = $(BINDIR)/game_r$(GAME_VERSION)_test

# previously -> default: $(MAIN_TARGET) $(TEST_TARGET)
default: $(MAIN_TARGET)
test: $(TEST_TARGET)

$(OBJDIR)/%.o: %.c
    @echo compiling $<
    @$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @$(CC) -MM -MG -MP $(CFLAGS) $(INCDIR) -c $< -o $(OBJDIR)/$*.d
    @sed -i '' -e's/$*.o:/$(OBJDIR)\/$*.o:/g' $(OBJDIR)/$*.d
endif

$(OBJDIR)/%.o: %.cpp
    @echo compiling $<
    @$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @$(CC) -MM -MG -MP $(CFLAGS) $(INCDIR) -c $< -o $(OBJDIR)/$*.d
    @sed -i '' -e's/$*.o:/$(OBJDIR)\/$*.o:/g' $(OBJDIR)/$*.d
endif

limit_time:
    @echo update limit time
    @python update_limit_time.py

$(MAIN_TARGET): $(CPPOBJS) $(COBJS) $(MAINOBJ)
    @echo linking $(MAIN_TARGET)
    @$(CC) $(CFLAGS) $(LIBDIR) $(COBJS) $(CPPOBJS) $(MAINOBJ) $(LIBS) -o $(MAIN_TARGET)

$(TEST_TARGET): $(TESTCPP) $(CPPOBJS) $(COBJS) $(TESTOBJ)
    @echo linking $(TEST_TARGET)
    @$(CC) $(CFLAGS) $(LIBDIR) $(COBJS) $(CPPOBJS) $(TESTOBJ) $(LIBS) -o $(TEST_TARGET)

dump:
    @$(CC) -dM -E - < /dev/null > .nope.nope

symlink:
    @ln -fs game_r$(GAME_VERSION) $(BINDIR)/game_symlink

strip:
    @cp $(BINDIR)/game_r$(GAME_VERSION) $(BINDIR)/game_r
    @strip $(BINDIR)/game_r

clean:
    @rm -f $(COBJS) $(CPPOBJS) $(MAINOBJ) $(TESTOBJ)
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @rm -f $(CDEPS) $(CPPDEPS) $(MAINDEPS) $(TESTDEPS)
endif
    @rm -f $(BINDIR)/game_r* $(BINDIR)/conv

cc-ver:
    @$(CC) -v

tag:
    ctags *.cpp *.h *.c

dep:
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
    @echo "Note: gcc autodepend is autodetected, so target dep skipped"
else
    makedepend -f $(DEPFILE) $(INCDIR) -I/usr/include/c++/3.3 -I/usr/include/c++/4.2 -p$(OBJDIR)/ $(CPPFILE) $(CFILE) $(MAINCPP) $(TESTCPP) 2> /dev/null > $(DEPFILE)
endif

# AUTO_DEPEND_CHECK BEGIN
ifeq ($(ENABLE_GCC_AUTODEPEND), 1)
sinclude $(CDEPS)
sinclude $(CPPDEPS)
sinclude $(MAINDEPS)
sinclude $(TESTDEPS)
else
sinclude $(DEPFILE)
endif
# AUTO_DEPEND_CHECK END
 

 

Build mariadb by src with a 32bit os/jail and use the same compiler version and same std flag,.

Share this post


Link to post
Share on other sites

Hello,

I recently updated to mariadb 103.
Your tutorial worked like a charm.
My Files are updated and compiled.

But now i have the following problem:

  • Can`t connect to mysql server through socket
  • cannot start server while no common sql connected


The Channel and db syserr`s are clean. There is also no error in the mysql *hostname*.err.
The only thing i could find is the following Problem at the Ch1 Syslog:

  • CREATING DIRECT_SQL
  • AsyncSQL: locale latin1 failed retrying in 5 seconds

Have i done something wrong ? Could you please help me ?

Share this post


Link to post
Share on other sites

Why would you need to change anything? MariaDB is fully compatible with MySQL. Just uninstall MySQL and install MariaDB instead and that's it. There's nothing to change in the files.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×