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

Comment?

Note: Comment may not appear right away.

20 comments on “Compiling eAthena with GCC in Cygwin

    1. Looks like my email has revealing my id. Kali kali pake bahasa Inggris biar gaya bos haha
      awww.. it’s really pain in the butt if I try to use VS. Because I don’t have one. In otherwords I have to download it about 600+ mb :(
      btw, mau tanya sebenernya compile itu gunanya apa? saya masih kurang ngerti sampe sekarang. sorry masih pemula gan :D

    2. oh terus pas saya
      /configure -without-server
      muncul tulisan kaya gini
      “checking for termcap functions library… configure: error: No curses/termcapbrary found”
      itu kira kira kenapa ya bos?

    3. Hehehe kan kita cinta bahasa lokal :P . Trus kalau error itu muncul berarti karena ada library yg kurang, dalam kasus ini libcurses (yg pasti dependansinya bukan cuma curses aja). Trus compile itu proses buat ngebikin executable, dari source code.

      Sekedar cerita plus info :D … klo mo pakai eAthena di Windows biar maknyos performanya, lebih baek compile pake VS aja. Waktu jaman dulu banget (pas Ragnarok masih beken banget lah istilahnya), eAthena (atau tepatnya Athena dulu) itu cuma bisa di compile pakai Cygwin karena ga ada native buat Visual Studio, tapi entah sejak kapan mereka support VS juga (ga tau sejak kapan karena ane sendiri dah ga nyentuh lagi sih dah lama banget), tentu aja compile Native pakai VS akan lebih baek

      Tapi klo ga mau repot / cape2 compile (yah klo buat iseng2 aja gitu mo coba2 tinggal pake aja) … lebih baek ambil yg udah di compile ama orang aja :D

  1. Om, kalau yang compile/recompile txt server gemana ?

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

  2. # 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. 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. 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. 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. 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

  7. 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.