Agar on Windows 7 with MSYS and a 64-bit Compiler

This tutorial describes how to compile the Agar widget toolkit on Windows 7 with MSYS and a 64-bit compiler. Default selections are implied whenever a step is skipped.

  1. Install VirtualBox.

  2. Create a virtual machine with the following settings.
    Windows, Windows 7 64-bit, 2048 MB, 64 GB Hard Drive

  3. Snapshot the virtual machine.

  4. Connect the Windows 7 64-bit install CD to the virtual machine.

  5. Start the virtual machine.

  6. Enter the following values.

    • User name: user
    • Computer name: USER-PC
    • Password: ChangeMe
    • Confirm password: ChangeMe

  7. Set the time zone.

  8. Ensure CD is ejected within Windows, shutdown, make sure CD is removed within VirtualBox, take snapshot, start virtual machine.

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

  10. Disable auto updates, install updates, change update settings to download updates but allow you to choose whether to install them, shutdown, take snapshot, start virtual machine.

  11. Install Chrome.

  12. Install MSYS with the packages listed below.

    • Basic Setup > msys-base
    • All Packages > msys-perl > bin

  13. Install the win-builds MinGW-w64 package manager and select the following settings then click Process.

    • Select the system to install for: Cygwin or MSYS
    • Select the architecture to install for: x86_64
    • Choose the directory of an existing Cygwin or MSYS installation: C:\MinGW

  14. Install Notepad++.

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

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

  17. Install the 64-bit version of SlikSVN.

  18. This step isn't necessary unless you're verifying the absence of negative side effects from a bug fix for installing Agar with the 32-bit version of MSYS and MinGW. 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.

  19. Set your user PATH environment variable to the following setting. Click Start, right click Computer and select Properties, click "Advanced System Settings" > "Environment Variables", within "User variables for user" click "New…", enter the following values and then click the three OK buttons and close the computer properties window.

    • Variable name: PATH
    • Variable value: C:\MinGW\msys\1.0\opt\windows_64\bin

  20. 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/msys/1.0/opt/windows_64/x86_64-w64-mingw32 —without-{fontconfig,freetype,sdl,png,jpeg,iconv,gettext,uim,db4,mysql,sndfile,manpages} —disable-threads}
    • make depend all
    • make install
    • exit

  21. 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);

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

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