How-To: Download, Build, Debug a sample Clutter app

  1. Download the sample_apps tarball
    • Download sample_apps.tar.gz
    • or

    • Go to moblin.org > Downloads > Git Repositories
    • Find and click on moblin2/sample_apps.git
    • At the top of the log is the most updated source. To the right of the top entry, you'll find a link named 'snapshot'
    • Click 'snapshot' to download the tarball

    Note: For the purposes of this tutorial, the tarball will be known as sample_apps.tar.gz

  2. Install and Run Image Creator
  3. /documentation/installing-image-creator

  4. Create a new project and target
  5. /documentation/creating-projects-and-targetsmic_smallth.png

    Note: When you add a new project, you must select an empty folder.

      Chose any name, desc, and path, and set the platform to netbook-lpia-moblin2
      For this tutorial, I used the following values:
       Project name: clutter_apps
       Project desc: testing apps
       Project path: ~/src/app_example
       Platform: netbook-lpia-moblin2
       Target name: helloworld
       Functional sets: Select app-devel-environment. This automatically selects appframework, applications, x, x-dev, core, and core-dev.

  6. Copy sample_apps.tar.gz to the target
  7. The target file system is located under the project file system. On your workstation you can find the target file system in:
         <path to project>/targets/fs/<name of target>/

    $ sudo cp <download path>/sample_apps.tar.gz \
                 ~/src/app_example/targets/helloworld/fs/root/
     

  8. Install Clutter libraries
  9. Open a terminal to the target file system. In Image Creator select your target and click the Terminal button. Image Creator will open a terminal chroot-ed to the target directory. Inside this terminal install the clutter development package:

    # yum install clutter-devel.i386
     

  10. Build Clutter HelloWorld
  11. In the target terminal:

    # cd /root
    # tar xvzf sample_apps.tar.gz
    # cd moblin2/sample_apps.git/
    # ./autogen.sh --prefix=/usr
    # cd helloworld
    # make install

    HelloWorld is now installed in the target. You will see this when you run the target in a virtual machine or on a mobile device.
     

  12. Create an image
  13. /documentation/creating-image-target-device
    For this tutorial, I created a live image and named it helloworld.img

  14. Launch the image
  15. Check to ensure that your CPU supports hardware virtualization.

    (For me, virtualization was not enabled. I enabled it through the BIOS.)

    qemu_kvm_terminal_smallth.png

    • Click Launch VM button
    • Select helloworld.img
    • Click OK. A qemu/KVM window will launch. If it does not, check the terminal where Image Creator was started for error information.
    • Press Enter. The kernel will load and the image will boot in the virtual environment.
  16. Launch the Clutter Helloworld app
  17. helloworld_smallth.png

    • Click inside the qemu/KVM window to give it focus.
    • Hover your cursor to the left edge of the desktop and a menu will slide out
    • Click the terminal icon.
    • In the terminal in the qemu/KVM window start HelloWorld:
    • $ cd moblin2/sample_apps.git/helloworld
      $ ./helloworld

    Note: The helloworld app will pop up and start doing its thing. In order to exit the qemu/KVM window, press ctrl + alt. This will allow you to click the 'X' in the upper right hand corner.

  18. To Debug:
  19. With the helloworld target selected, click the terminal icon in Image Creator.
    Note: Make sure you have gdb installed on your target.

    # yum install gdb.i386
    # cd ..
    # cd home/user/moblin2/sample_apps.git/helloworld
    # gdb ./helloworld

    (gdb) b main  //set break point at main
    (gdb) r           //start running the executable
    (gdb) q          //to quit

Comments (1 total)

broken link