You are currently browsing the archives for the Programming category.

Getopt++ library

I was looking for a clean way of handling command line options in C++. A guy called Robert Collins has developed the getopt++ library for use in cygwin. It’s quite tidy but there is very little information available about how to use it. The libraries and headers are available from the Debian repository under the name libgetopt++1 and libgetopt++-dev. There is a rather brief Readme file but the usage section has yet to be written here is some sample code that may be useful.
Read more…

Lejos missing libraries

Lejos lets you run Java on Lego Mindstorm robots. Lejos 3 RC2 for the RCX bricks can run fine on Linux but initially gave the following error:
Unable to load native libraries: /usr/local/lejos/bin/libjirtrcx.so: libirtrcx.so: cannot open shared object file: No such file or directory.

Adding the following lines to your .profile should help, I don’t think the LD_LIBRARY_PATH was mentioned in the documentation.

export LEJOS_HOME=/usr/local/lejos
export PATH=$PATH:$LEJOS_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LEJOS_HOME/bin
export RCXTTY=/dev/usb/legousbtower0

You may also need to chmod 666 /dev/usb/legousbtower0 or add some udev rules to ensure your user has write access to the infrared tower.

Eclipse plugin folder

On Ubuntu Linux, Eclipse expects to find plugins in the /usr/local/lib/eclipse/ folder.

undefined reference to `__gxx_personality_v0′

This error undefined reference to `__gxx_personality_v0' might appear when you try to link C++ object files with the C linker (cc or gcc) instead of the C++ linker (g++). Maybe the Makefile is using some default values for the compiler.