Agar on Windows XP

This tutorial describes how to compile the Agar widget toolkit on Windows XP for the development of applications that have a graphical user interface. Default selections are implied whenever a step is skipped.

  1. Install VirtualBox.

  2. Create a virtual machine with the following settings.
    Windows, Windows XP 32-bit, 1024 MB, 64 GB Hard Drive

  3. Snapshot the virtual machine.

  4. Connect the Windows XP 32-bit install CD to the virtual machine.

  5. Start the virtual machine.

  6. Enter the following values.

    • Name: User
    • Computer name: XP
    • Administrator password: ChangeMe
    • Confirm password: ChangeMe

  7. Set the time zone.

  8. Enter the following values.

    • Your name: User

  9. Take the install disk out of the drive. In VirtualBox select the menu Devices > CD / DVD Devices > Remove disk from virtual drive.

  10. If you use the Dvorak keyboard layout, set it as the default, then delete the QWERTY keyboard layout.

  11. Install updates. I disable automatic updates and do custom updates from the menu Start > All Programs > Windows Updates.

  12. Eject the CD within Windows, make sure CD is removed from the virtual machine, shut down the virtual machine, take a snapshot, start the virtual machine.

  13. Install the VirtualBox guest additions.

  14. Install Chrome.

  15. Install MinGW with MSYS with the packages listed below.

    • Basic Setup > mingw-developer-toolkit
    • Basic Setup > mingw32-base
    • All Packages > mingw32-pthreads-w32 > dev

  16. Install Notepad++.

  17. Duplicate C:\MinGW\msys\1.0\etc\fstab.sample and rename it fstab without a file extension.

  18. Within Notepad++ open C:\MinGW\msys\1.0\etc\fstab and put a # in front of the second to last line that mentions perl and save the changes.

  19. Install the 32-bit version of SlikSVN.

  20. After running the first command of the next step, check whether the bug at the following address has been fixed and if it hasn't been fixed then apply the fix mentioned in the bug's description.

  21. Run C:\MinGW\msys\1.0\msys.bat and then enter the following commands.

    • svn export ~/agar —native-eol LF
    • cd ~/agar
    • ./configure —prefix=/mingw —with-gl=/mingw —without-{fontconfig,freetype,sdl,png,jpeg,iconv,gettext,uim,db4,mysql,sndfile,manpages}
    • make depend all
    • make install
    • exit

  22. Within Notepad++ create the file C:\MinGW\msys\1.0\home\User\hello.c then copy the following text and paste it into Notepad++ and then save the file.

    #include <agar/core.h>
    #include <agar/gui.h>

    main(int argc, char *argv)
      AG_Window *win;

      if (AG_InitCore(NULL, AG_VERBOSE) == -1 ||
        AG_InitGraphics(0) == -1) {
        AG_Verbose("Init failed: %s\n", AG_GetError());
        return (1);
      win = AG_WindowNew(0);
      AG_LabelNew(win, 0, "Hello, world!");
      return (0);

  23. Run C:\MinGW\msys\1.0\msys.bat and then enter the following commands.

    • cc -o hello `/mingw/bin/agar-config —cflags` hello.c `/mingw/bin/agar-config —libs`
    • ./hello.exe

  24. To quit the program, press ctrl-c within the terminal window.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License