Wednesday, February 27, 2013

linker: undefined reference to 'clock_gettime'

while compiling an old project that uses the function clock_gettime on gcc compiler i had the error " undefined reference to 'clock_gettime'", and after minutes of search the solution was to add the real time library "librt.so" or "librt.a" if static linking is needed. add the "-lrt" parameter to gcc if you are compiling manually, and if you are using IDE like codeblocks, from 'settings' , 'compiler' , 'linker settings', 'other linker options' and add "-lrt" then press ok .


Thursday, February 14, 2013

How to share folders between linux (host) and windows(guest) using Oracle VirtualBox



1- Setup a virtual HD and install windows on it.
2- From VBox settings, go to 'shared folder' and add new folder. also you may check automount option.


3- Download virtualbox additions CD , and it should be same as your VBox version (ex: VBoxGuestAdditions_4.2.4.iso)
4- Add the iso image to your virtual devices and boot into windows
5- From windows open CD and install the additions, this will install many drivers and you may need to reboot windows.


6- From windows go to 'my computer', you will find your shared drives. enjoy!




Thursday, February 7, 2013

switching keyboard layout in Fedora 18

run the gnome-tweak-tool, if you don't have it then install it #yum install gnome-tweak-tool and then click on Typing. in the very last setting in this menu, 'Modifiers-only input sources switcher shortcut', lets you choose one of several commonly-used shortcuts for this purpose.


Tuesday, February 5, 2013

Qt: "cannot find -lGL" when linking, Fedora

When linking q project in qt on fedora system i saw the error "cannot find -lGL" , and after investigation i found that the IDE is searching for libGL.so while my library name on the system is called libGL.so.1 , so i just created a soft link  with .so ln -s /usr/lib/libGL.so.1 /usr/lib/libGL.so and then everything worked fine.