Reaper-X » Guide » Misc. Games » Software » Video Games » Windows » Compiling eAthena with GCC in Cygwin

Compiling eAthena with GCC in Cygwin

Since i got interested on playing Ragnarok online once again, so i decided to create this guide .. and this guide is useful to those who’s interested on running their private ragnarok online server from home .. but if it’s for me i use this to test build, finding rare items, etc without doing real work (read: if you play on private server you’ll need to get the items manually) because i can type any items i want as a GM (Game master). But instead of telling you on how to setup server (i’ll write more about this at later time). This post will tell you on how to build / compile eathena in Windows with GCC (GNU Compiler Collection) in Cygwin

And to those who didn’t know or never heard about eathena. eAthena is an open-source project, emulating a Ragnarok Online Server

Getting SVN Client

First of all, in order to fetch the latest eathena files from it’s Subversion repository you’ll need a SVN client program. And in Windows there are 2 ways of doing this (both of them are free) :

  1. TortoiseSVN : A free Windows SVN client which is implemented as a windows shell extension (in the other words, you can fetch svn files by right clicking)
  2. SVN client under Cygwin : You can also get SVN under Cygwin by choosing to download it from the development tools section when you’re installing Cygwin (detail below)

And it’s up to you to choose which one you think is best for you (but in this post im going to tell you on how to use the svn under cygwin). And if you decided to use Tortoise i assume you’ve already installed it, but to those who’s decided to use SVN from cygwin i’m sure you havent installed it yet

Installing Cygwin

Now as for the next step, grab Cygwin from here and download the setup.exe and save it somewhere on your harddrive (i suggest you to create new directory). And do the same steps like installing any other program until you reached this screen

Cygwin Installation Screen

Expand the development (devel) branch and see if GCC and Make already checked. If it is not checked by default then check it by yourself because it is needed, also if you decided to use the svn client from cygwin do not forget to checked it too

As for the other files, well .. you can decided whether you want to download the package or not (it’ll tell you if the package need dependancies from other package) … either way .. it’ll take a while before you finished downloading this into your computer so feel free to do anything you want while downloading the cygwin files

As an addition, you might try looking at the nearest mirror while downloading the cygwin package (if it’s for me although the nearest mirror located at kambing.vlsm.org, because it always give me problem like connection loss, etc .. i decided to use the cygwin.osuosl.org mirror)

When you’ve finished downloading run the cygwin shell from your desktop or start menu to create your user account directory, and then press CTRL+D (logout from cygwin shell)

Grab the MySQL Source

Yet another big download (at least for me), this time you must download MySQL Source to compile the library needed for eathena (sql version) and you can grab it from this page (choose the compressed gnu tar archive, and at the time i wrote this post the latest mysql version available is 5.0.37)

And when you’ve finished downloading the mysql source. Move or copy the tar archive into your cygwin home directory (for example if you installed cygwin in C:\Cygwin . Your user directory would be C:\Cygwin\home\Your_Windows_Username) which is created during the previous process which is involving the CTRL+D key

Grab the latest eathena SVN

1. If you’re using SVN under Cygwin :

Type this at the cygwin command prompt (shell) :

  • mkdir eathenasvn
  • cd eathenasvn
  • svn co http://svn.eathena.ws/svn/ea/trunk . (can also be viewed using your browser. Oh .. and don’t forget the last dot) .. and the next time when you want to update it, you can just simply type :
  • svn update

And the end results would be like this for an example :

C:\Cygwin\home\Your_Windows_Username\eathenasvn (where the versioned eathena files located)

2. If you’re using TortoiseSVN :

  • create new directory (for example eathenasvn)
  • go inside that directory
  • right click and choose checkout
  • insert this url or the above svn url at this screen (like below image) :

 eathena SVN in TortoiseSVN

Compiling MySQL Client Library

From the cygwin command prompt type this :

  • tar zxf mysql-5.0.37.tar.gz
  • cd mysql-5.0.37
  • ./configure —without-server
  • make && make install

Now you have to wait until the compile process finished (it’ll take a while so feel free to browse around the net if you got bored)

As a side note, there are other configure flags you can set (try playing around the configure options) .. but the above configure flags already sufficient for most users

Exporting unversioned eathena files and compile it

1. If you’re using SVN under cygwin type this at the shell (note: the directory where versioned eathena located is in the previous step) :

  • cd $home
  • svn export eathenasvn eathenasvnbuild
  • cd eathenasvnbuild
  • make sql (if you want to use mysql) / make txt (if you want to use the flatfile database / txt version)

2. If you’re using TortoiseSVN, choose export by right clicking on the eathenasvn directory and choose the export path .. as for the rest it’s the same like above. With the exception you must go to where unversioned eathena located and type make sql / make txt

As an addition, if you want to use other C Flags you can edit the eathena makefile

That’s it you’ve finished compiling eathena by yourself .. as for the next / future post (that’s because i want to play World of Warcraft in Private server for the first time .. :P ), i would create a guide on how to setup your own ragnarok private server using eathena

Leave a Comment

  1. nick said Mar 23, 2009 at 1:01 pm

    Om, kalau yang compile/recompile txt server gemana ?

    How about compile/recompile txt server ?
    Is compiling txt server diffrent with sql server ?

  2. Reaper-X said Jan 23, 2009 at 3:03 pm

    # lhades

    try recompile zlib

    # kevin

    Actually now you can use Visual Studio to compile eathena (if you prefer a much easier way), or if you prefer to compile it using cygwin, you’ll need to download mysql source first and compile mysql (you just need the library in order to compile eathena)

    p.s if you choose to compile using visual studio, make sure to add the mysql lib path into vs lib path

  3. kevin said Jan 23, 2009 at 7:51 am

    Guys i tried it and i got this after ./configure
    make :***[needs_mysql] Error 1

    but i have a mysql admin and query…
    i am running an expert server and yet i cant compile because i supposedly dont have MySQL, please help me D:

  4. Ihades said Jul 10, 2008 at 7:47 am

    I typed out
    ./configure and it configured and after sometime this is what appears…
    “configure: error: zlib library not found or incompatible, please specify the correct path with –with-zlib=DIR.. stopping”
    Mind helping me out?

  5. Leo said Nov 23, 2007 at 5:08 am

    make[2]: *** [login-server_sql] Error 1
    make[2]: Leaving directory `/cygdrive/c/Documents and Settings/Leo/eathenasvnbui
    ld/src/login_sql’
    make[1]: *** [login_sql] Error 2
    make[1]: Leaving directory `/cygdrive/c/Documents and Settings/Leo/eathenasvnbui
    ld’
    make: *** [sql] Error 2

    i can’t “make sql” i’ve tried make clean, ./configure, but I dont think i did the mysql part correctly. i already installed mysql beforehand, it already works with the server, i’ve just been trying to compile.

  6. Sully said Oct 26, 2007 at 7:12 am

    what is this suppose to be?

    i dont understand

  7. Ryan said Sep 22, 2007 at 10:35 pm

    Yes!! It worked!! Thank you so much! =P

  8. Reaper-X said Sep 22, 2007 at 5:50 pm

    Sorry for late reply i didn’t saw your comment :(

    btw i just take a look at the ea svn, and it seems that you need to run the configure script this time :)

    so you need to run ./configure first

  9. Ryan said Sep 21, 2007 at 9:31 am

    Everything works up to ‘make sql’. Then its saying “*** No rule to make target ’sql’”. Any idea whats wrong?

  10. Reaper-X said Aug 31, 2007 at 10:22 am

    Actually you just need to type :)

    $ make clean
    $ make

  11. Lai said Aug 30, 2007 at 11:09 pm

    Hi there.
    Can you teach me how to recompile the server?
    I made some changes in the src folder, but they do not work until I recompile it.

    Please give me futher instructions.

    Kind regards, Lai.

  12. vickash said Aug 16, 2007 at 7:00 am

    can u please help me create a ro server
    please please please
    and please e-mail it to me at de_laides_lover@yahoo.com

  13. vickash said Aug 16, 2007 at 6:54 am

    can u help me creat and ro server plese email me at de_laides_lover@yahoo.com

CommentLeave a response

Please read our comment policy | XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>