You are not logged in.

#1 2010-02-13 17:50:18

teMplaryum
Member
From: Serbia
Registered: 2007-09-11
Posts: 30
Website

[SOLVED] Trouble compiling EVEmu

I doubt many archers are familiar with this project, so I'll give a very brief outline. EVEmu is an attempt to make an EVE Online (a space-based MMORPG) emulator, in much the same way MaNGOS emulates a World of Warcraft server, although evemu's approach is somewhat different, and, of course, this challenge is much more difficult to tackle. EVE Online is best known for its two servers, Serenity and Tranquility. The former one serves China and the latter one serves the rest of the World. Both of them are massive computer clusters, comprising of vast number of nodes that handle client connections, databases and gameplay (if you're interested in more info http://wiki.eveonline.com/wiki/Tranquility). These servers are capable of serving a huge number of players at the same time (while I played on a trial account, daily peek of population on Tranquility was around 50 thousand players). And the amazing thing is that every single one of them is playing in a single universe, spanning over 7 500 solar systems.

I got carried away big_smile. Anyway, even if you're not a gamer, this feat of programming is nothing short of astonishing. That's why I'm trying to contribute to EVEmu, because I think lot of interesting stuff can be learned from it. EVEmu project is several years old, but it had frequent changes in general development ideas, main developers, branches, etc. Not much has been done overall (client can connect to the server, you can create characters and do some free-space flight), and for some time now, SVN access is limited to one dev who is rewriting the whole core all by himself.

Now, the problem that this thread is about is that I cannot compile the latest revision. Something really odd seems to be happening to the linker. These are the lines of interest:

/bin/sh ../../libtool --tag=CXX   --mode=link g++ -pipe -fno-inline -Wall -ansi -I/usr/include/mysql  -fPIC -pipe -fno-strict-aliasing   -DUNIV_LINUX -DUNIV_LINUX -I./../../dep/ -I./../../include/common/ -I./../../include/eve-common/ -I./../../include/eve-server/ -g -O2 -Wl,--hash-style=gnu -Wl,--as-needed -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lz -lpthread  -o eveserver NetService.o Client.o ClientSession.o EntityList.o EVEmuServerConfig.o main.o PyBoundObject.o PyCallable.o PyService.o PyServiceMgr.o ServiceDB.o libaccount.a libadmin.a libcache.a libcharacter.a libchat.a libcorporation.a libconfig.a libdogmaim.a libinventory.a libmanufacturing.a libmap.a libmarket.a libmining.a libmissions.a libstanding.a libnpc.a libspawn.a libship.a libstation.a libsystem.a libtutorial.a libposmgr.a ./../eve-common/libevecommon.a ./../eve-common/packets/libpackets.a ./../common/libcommon.a ./../../dep/utils/libutils.a ./../../dep/tinyxml/libtinyxml.a ./../../dep/gangsta/libgangsta.a -lz 
libtool: link: g++ -pipe -fno-inline -Wall -ansi -I/usr/include/mysql -fPIC -pipe -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -I./../../dep/ -I./../../include/common/ -I./../../include/eve-common/ -I./../../include/eve-server/ -g -O2 -Wl,--hash-style=gnu -Wl,--as-needed -rdynamic -o eveserver NetService.o Client.o ClientSession.o EntityList.o EVEmuServerConfig.o main.o PyBoundObject.o PyCallable.o PyService.o PyServiceMgr.o ServiceDB.o  -L/usr/lib/mysql -lmysqlclient -lcrypt -lnsl -lm -lpthread libaccount.a libadmin.a libcache.a libcharacter.a libchat.a libcorporation.a libconfig.a libdogmaim.a libinventory.a libmanufacturing.a libmap.a libmarket.a libmining.a libmissions.a libstanding.a libnpc.a libspawn.a libship.a libstation.a libsystem.a libtutorial.a libposmgr.a ./../eve-common/libevecommon.a ./../eve-common/packets/libpackets.a ./../common/libcommon.a ./../../dep/utils/libutils.a ./../../dep/tinyxml/libtinyxml.a ./../../dep/gangsta/libgangsta.a -lz
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBQueryResult::SetResult(st_mysql_res**, unsigned int)':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:509: undefined reference to `mysql_free_result'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:521: undefined reference to `mysql_fetch_field'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBQueryResult::Reset()':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:446: undefined reference to `mysql_data_seek'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBQueryResult::GetRow(DBResultRow&)':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:431: undefined reference to `mysql_fetch_row'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:435: undefined reference to `mysql_fetch_lengths'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `~DBQueryResult':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:423: undefined reference to `mysql_free_result'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:423: undefined reference to `mysql_free_result'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBcore::Open_locked(int*, char*)':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:299: undefined reference to `mysql_real_connect'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:311: undefined reference to `mysql_set_character_set'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:314: undefined reference to `mysql_errno'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:316: undefined reference to `mysql_error'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:316: undefined reference to `mysql_errno'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:283: undefined reference to `mysql_close'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBcore::DoEscapeString(char*, char const*, int)':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:217: undefined reference to `mysql_real_escape_string'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBcore::DoEscapeString(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:224: undefined reference to `mysql_real_escape_string'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBcore::DoQuery_locked(DBerror&, char const*, int, bool)':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:154: undefined reference to `mysql_real_query'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:155: undefined reference to `mysql_errno'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:167: undefined reference to `mysql_error'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBcore::RunQuery(char const*, int, char*, st_mysql_res**, int*, int*, int*, bool)':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:196: undefined reference to `mysql_field_count'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:197: undefined reference to `mysql_store_result'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:209: undefined reference to `mysql_affected_rows'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:211: undefined reference to `mysql_insert_id'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBcore::RunQueryLID(DBerror&, unsigned int&, char const*, ...)':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:144: undefined reference to `mysql_insert_id'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBcore::RunQuery(DBerror&, unsigned int&, char const*, ...)':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:123: undefined reference to `mysql_affected_rows'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBcore::RunQuery(DBQueryResult&, char const*, ...)':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:73: undefined reference to `mysql_field_count'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:80: undefined reference to `mysql_store_result'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBcore::ping()':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:55: undefined reference to `mysql_ping'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `~DBcore':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:44: undefined reference to `mysql_close'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:44: undefined reference to `mysql_close'
./../common/libcommon.a(libcommon_a-dbcore.o): In function `DBcore':
/home/user/evemu/trunk/src/common/database/dbcore.cpp:38: undefined reference to `mysql_init'
/home/user/evemu/trunk/src/common/database/dbcore.cpp:38: undefined reference to `mysql_init'
./../common/libcommon.a(libcommon_a-TCPConnection.o): In function `TCPConnection::StartLoop()':
/home/user/evemu/trunk/src/common/network/TCPConnection.cpp:232: undefined reference to `pthread_create'
./../common/libcommon.a(libcommon_a-TCPServer.o): In function `BaseTCPServer::StartLoop()':
/home/user/evemu/trunk/src/common/network/TCPServer.cpp:157: undefined reference to `pthread_create'
./../common/libcommon.a(libcommon_a-Mutex.o): In function `Mutex::trylock()':
/home/user/evemu/trunk/src/common/threading/Mutex.cpp:139: undefined reference to `pthread_mutex_trylock'
./../common/libcommon.a(libcommon_a-Mutex.o): In function `Mutex':
/home/user/evemu/trunk/src/common/threading/Mutex.cpp:82: undefined reference to `pthread_mutexattr_init'
/home/user/evemu/trunk/src/common/threading/Mutex.cpp:86: undefined reference to `pthread_mutexattr_settype'
/home/user/evemu/trunk/src/common/threading/Mutex.cpp:89: undefined reference to `pthread_mutexattr_destroy'
/home/user/evemu/trunk/src/common/threading/Mutex.cpp:82: undefined reference to `pthread_mutexattr_init'
/home/user/evemu/trunk/src/common/threading/Mutex.cpp:86: undefined reference to `pthread_mutexattr_settype'
/home/user/evemu/trunk/src/common/threading/Mutex.cpp:89: undefined reference to `pthread_mutexattr_destroy'
collect2: ld returned 1 exit status
make[3]: *** [eveserver] Error 1
make[3]: Leaving directory `/home/user/evemu/trunk/src/eve-server'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/user/evemu/trunk/src/eve-server'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/user/evemu/trunk'
make: *** [all] Error 2

Code compiles flawlessly in a virtual Linux guest (I tried compiling it in SliTaz Linux) and on my Windows guest. The interesting thing is that I get the same errors in my fresh-installed Arch Linux guest VM, which makes this a distro-wide artifact.

I have latest gcc, make, autoconf, automake, m4, mysql, mysql-clients, libmysqlclient and zlib. I'd be really grateful if someone found out what's wrong. Also, you could try compiling it on your boxes, just see if the above pops up, and post you results here.

Get the code with (u: anonymous, p: anonymous):

svn checkout http://mmoforge.org/svn/evemu/trunk

Wiki:

http://wiki.evemu-project.co.cc/CompilingLinux

In the end of this long post, I just wanted to invite all of you who are interested in contributing to open source projects, freelance programming, coding, care for teamwork and have some good will to help this project, you will certainly learn a lot in return, and, hopefully, have some fun smile.

Thanks in advance,
Dimitrije

Last edited by teMplaryum (2010-02-16 22:40:37)


Online at:
Twit | Facebook | Blog

Registered Linux user #469726

Offline

#2 2010-02-16 22:40:20

teMplaryum
Member
From: Serbia
Registered: 2007-09-11
Posts: 30
Website

Re: [SOLVED] Trouble compiling EVEmu

I've got it! Just needed to remove

-Wl,--as-needed

flag from the last linker command.

After little googling --> http://www.gentoo.org/proj/en/qa/asneeded.xml

Warning: At the time of writing, there are many packages failing in funny ways because of --as-needed as they weren't designed to be used with it. While there shouldn't be (note the conditional) problems such as crashes, this flag is not considered safe for production use and not supported in any way by Gentoo.

Damn it, I've lost much time trying to sort this one out. I just hope some people got my message about EVEmu.

Over and out.


Online at:
Twit | Facebook | Blog

Registered Linux user #469726

Offline

#3 2010-02-17 10:59:30

teMplaryum
Member
From: Serbia
Registered: 2007-09-11
Posts: 30
Website

Re: [SOLVED] Trouble compiling EVEmu

I don't wanna create a new thread about this, so I'll just put this here.

I made EVEmu package, if you are interested and have some spare time you can check it out.


Online at:
Twit | Facebook | Blog

Registered Linux user #469726

Offline

Board footer

Powered by FluxBB