Posts Tagged ‘Linux’

Eclipse C/C++ and Linux Libraries

Posted in C/C++, Linux, Programming on February 4th, 2009 by Nick – 13 Comments

This is a really quick tutorial on configuring Eclipse CDT (C/C++ Development Tools) so you can work with shared libraries.  A lot of this may be basic for some readers, but for a programmer that’s used to Visual Studio and a Windows dll environment it may not.  read more »

** Unable to load Mozilla for hosted mode ** (GWT & Ubuntu 8.10 Linux)

Posted in GWT, Linux, Ubuntu on January 2nd, 2009 by Nick – 18 Comments

I’ve recently been working with GWT (Google Web Toolkit) and ran into a small snag configuring it on my Ubuntu 8.10 setup.  This will be a short HOW-TO for configuring GWT on Ubuntu or other linux distros.  The three topics I’m going to talk about are:

  • Getting the hosted browser working in linux
  • Dealing with an external browser error when using Compile/Browse
  • Adding GWT to the path.

Getting the Hosted Browser Working in Linux
When trying to run using the hosted browser (shell) I got the following exception:

** Unable to load Mozilla for hosted mode **
java.lang.UnsatisfiedLinkError: /home/hellz/projects/gwt-linux-1.5.3
/mozilla-1.7.12/libxpcom.so: libstdc++.so.5:
cannot open shared object file: No such file or directory
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1674)
 at java.lang.Runtime.load0(Runtime.java:770)
 at java.lang.System.load(System.java:1005)
 at com.google.gwt.dev.shell.moz.MozillaInstall.load(MozillaInstall.java:190)
 at com.google.gwt.dev.BootStrapPlatform.init(BootStrapPlatform.java:49)
 at com.google.gwt.dev.GWTShell.main(GWTShell.java:354)

The key to troubleshooting the problem is in the second line, libstdc++.so.5 to be exact.  It can’t find this C++ library.  Turns out the hosted browser needs libstdc++5, but the version currently installed on my 8.10 system is libstdc++6.  So you can either:

Open System->Administration->Synaptic Package Manager and install libstdc++5
or
At a console type: sudo apt-get install libstdc++5

Now you should be running in a hosted browser fine.

Error on Compile/Browse
The second issue you might run into is GWT not recognizing your external browser.  You’ll know you have this problem after clicking on the Compile/Browse button.

You get an error that looks like:

[ERROR] Unable to find a default external web browser
[WARN] Try setting the environment variable GWT_EXTERNAL_BROWSER to
  your web browser executable before launching the GWT shell

The problem is that GWT can’t find your default installed browser (which is most likely firefox).  This is easy to fix:

  1. Open your .bashrc or .profile file, which is located in your home directory.  So type gedit ~/.bashrc or nano ~/.bashrc or however else you want to open it.  The reason I listed both files is because IMO the environment and pathing system of Ubuntu (and some other distros) is a spiderweb mess.  I modified my .bashrc, but I’m not sure if that’s best practice.
  2. Add this line to the bottom of the file: export GWT_EXTERNAL_BROWSER=/usr/bin/firefox
  3. Logout and log back in for the changes to take affect.

Now the Compile/Browse button should bring up your external browser.

Adding GWT to the path

Add PATH=”$HOME/projects/gwt-linux-1.5.3:$PATH” to your .bashrc (or .profile) file.  Of course you might have to modify the directory name to point where you have GWT installed.  For this to take effect you’ll have to logout and log back in as well.  You can double check your path to see if GWT has been added by typing echo $PATH. Once you have GWT added to your path you’ll be able to execute projectCreator and applicationCreator from anywhere.

iPods & Amarok, Part 4: Podcasts

Posted in Linux, Ubuntu on January 1st, 2009 by Nick – Be the first to comment

Most people think they need itunes to manage their ipods.  In this post I’ll show how to get audio from your favorite podcast to your ipod using Amarok on linux.  Before we start, you need to connect your iPod and make sure it comes up as an Amarok device.  If you need help with this refer to Part 1.


Adding the podcast to Amarok.

Before we can get the podcast onto the ipod, we’ll need to add it to Amarok.  Here are the steps to accomplish this:

  1. In Amarok, choose the Playlists tab.  You can find this in the set of vertical tabs on the left side.
  2. Right click on the red folder labeled “Podcasts”
  3. Select “Add Podcast…”
  4. Type or paste in the URL of a favorite podcast and click OK.  It will then retrieve the podcasts and you’ll see them in that red Podcasts folder.  Podcasts are typically taken from a RSS feed so the URL will most likely be an xml file.

Moving the podcast to your ipod.

  1. From that new list of available podcasts, you can now right click on one of them and choose ” Download Media”.  This will download the podcast as an audio file, so depending on how long the podcast is, it may take some time.
  2. Once the download is complete, you right click on that same podcast again and choose “Transfer to Media Device”.  This doesn’t do the actual copy to your ipod, but queues it up for the copy.
  3. Click on the Devices tab (same left side vertical tabs) and you’ll see everything on your ipod.  You’ll also see at the bottom a Transfer Queue, which you should also see your queued podcast.
  4. Last step is to click on the Transfer button at the top.

You’re done and should now see the podcast in your ipods menu in both Amarok and the ipod itself.

Here are all of the iPods and Amarok posts:
iPods and Amarok, Part 1: Making the Connection
iPods and Amarok, Part 2: Album Cover Art
iPods and Amarok, Part 3: Playlists
iPods and Amarok, Part 4: Podcasts

At the time of this blog, I’m using Ubuntu 8.10 (Intrepid Ibex), Amarok 1.4.10 and an iPod Nano (3rd Gen).

For this example I used a podcast from Clark Howard.

iPods & Amarok, Part 3: Playlists

Posted in Linux, Ubuntu on December 31st, 2008 by Nick – Be the first to comment

Creating a playlist for your iPod is one thing that is more intuitive on itunes than Amarok, but once you get schooled it’s pretty simple.  Before we start, you need to connect your iPod and make sure it comes up as an Amarok device.  If you need help with this refer to Part 1.

Creating a playlist on your iPod using Amarok:

  1. In the Devices tab, in the left window where it shows all the music on your iPod you’ll see at the very top a red folder labeled “Playlists”.  Right-click on that red folder and select “Create Playlist…”, then name the playlist.
  2. The next step is to add songs to the playlist.  In that same left window, right-click on the song or album you want, select “Add to playlist” and select the playlist you are adding to.

Just properly disconnect and unmount your ipod and you’re done.

I mentioned above that itunes has a bit more intuitive of an interface for playlists….let me explain why I think so….
The right side window in Amarok can’t be used at all to manipulate your playlist.  You can’t drag, or click and add from there.  I think this is a drawback and can be confusing, maybe they’ll change that in Amarok2.

Here are all of the iPods and Amarok posts:
iPods and Amarok, Part 1: Making the Connection
iPods and Amarok, Part 2: Album Cover Art
iPods and Amarok, Part 3: Playlists
iPods and Amarok, Part 4: Podcasts

At the time of this blog, I’m using Ubuntu 8.10 (Intrepid Ibex), Amarok 1.4.10 and an iPod Nano (3rd Gen).

iPods & Amarok, Part 2: Album Cover Art

Posted in Linux, Ubuntu on December 30th, 2008 by Nick – 1 Comment

This will be a quick explanation on how to get album covers on your iPod using Amarok.  This assumes you’ve already been able to connect to Amarok and copy music successfully.  If you have not, then refer to Part 1.

One thing a lot of people don’t know is that you can fetch any album covers you’re missing using Amarok.  It can’t hurt to run a fetch, it only takes a couple of minutes, it’s free and it will connect to AmazonMP3 to get all the covers you need for songs that are in your Amarok music library.

To fetch missing album art using Amarok:

  1. Go to Tools->Cover Manager.
  2. Click on “Fetch Missing Covers”.

Transferring the album art to you iPod:

  1. Click on the Devices tab in Amarok and make sure the iPod is connected.
  2. Click on the iPod button, and use the menu to set your iPod’s model. If you aren’t sure, Apple support site has the info you need.
  3. In that same iPod menu, click on Update Artwork.  Takes just a couple of seconds and you are done.

Now you can browse Iron Maiden albums by cover instead of name on your iPod.

Here are all of the iPods and Amarok posts:
iPods and Amarok, Part 1: Making the Connection
iPods and Amarok, Part 2: Album Cover Art
iPods and Amarok, Part 3: Playlists
iPods and Amarok, Part 4: Podcasts

At the time of this blog, I’m using Ubuntu 8.10 (Intrepid Ibex), Amarok 1.4.10 and an iPod Nano (3rd Gen).