Skip to main content

Linking on linux

I’ve just found out what some strange linking options mean with gcc! Quite often i’ve seen at the linking stage gcc object.o -o executable.out -lsomelibrary -Wl,-rpath,somepath I’ve discovered that the -Wl,-rpath,somepath expands basically to -Wl -rpath=somepath and this means the location of the shared library in somepath is hard coded into the executable to be used at runtime. rpath means runtime path, all of which means the dangerous LD_LIBRARY_PATH environment variable is not needed.

Allowing the use of clang in qmake

Clang is an attempt at creating a gcc replacement front end for *nix based systems with static code analysis and more helpful error messages etc. To allow the use of the clang compiler, the easiest way is to create a new mkspec, and create a Makefile with qmake -spec linux-clang See the link at the end of this post for the original credit, and a sample mkspec file. Credit here

Turn of middle click page loading in Firefox

In linux, the middle mouse button by default pastes the contents of the clipboard into something. If I had a penny for every time I’ve miss middle-clicked a link and tried to open a url like “for $file in `ls`”… To disable this “feature”, go to about:config in firefox then change middlemouse.contentLoadURL -> false This will disable middle-click url loading.

BBQ/World cup

Just been to a bbq at a friends house during which we watched the first world cup 2010 game that we were involved in (England vs. USA). Twas pretty rubbish really, 1-1 end score plus a complete fumble by the England goalkeeper. Not exactly decisive! Anway the bbq was good, ate too much as per usual but got to play some footy in the park. In all a good night.