How to fix the error “libstdc++.so.6: wrong ELF class: ELFCLASS64″ after installed GCC 4.6

30 05 2011

Hello folks. If you compiled and installed GCC 4.6 and during the Android Gingerbread (or another software) compilation you received the following error message: “libstdc++.so.6: wrong ELF class: ELFCLASS64″.

Don’t worry about that. You are just using a wrong architecture of the libstdc++.so.6 in the folder /usr/lib32 in Ubuntu 64 bits. To solve that, open a terminal, go to the place where you have built GCC 4.6 and run the commands below:

sudo cp build/x86_64-unknown-linux-gnu/32/libstdc++-v3/src/.libs/libstdc++.so.6.0.16 /usr/lib32
cd /usr/lib32

sudo rm libstdc++.so.6
sudo ln -s libstdc++.so.6.0.16 libstdc++.so.6
sudo ln -s libstdc++.so.6.0.16 libstdc++.so
sudo ldconfig

Doing that, we copied the libstdc++.so.6 for 32 bits in /usr/lib32 and also updated the links to this one. Now, all software that need this lib for 32 bits will use this one for compilation.

Remember, the lib libstdc++.so.6.0.16 is the version when I compiled GCC 4.6. If you get the file recently, this version will be different. Just don’t forget to change the reference to this one.

That’s it. See you next time.





What happend in the last week in Buildall

29 05 2011

How to fix problem of incompatibility between GCC 4.6 and Android 2.3 (Gingerbread): See how we can fix one problem that can happen when you try to compile the Android 2.3 after you already have installed GCC 4.6.

How to disable auto login in Ubuntu 11.04: You turned on your computer and noted, it did the login automatically. You already enable it through Login Screen Setting but you didn’t have success. Check out here how you can disabled auto login.

Changing Google Chrome user agent string in Ubuntu 11.04: See here how we can access sites that just accept for example Internet Explorer or where network that just accept the use of Internet Explorer instead of Google Chrome.

Creating a wallpaper slideshow in Ubuntu 11.04: If you are that one who like to get changing wallpaper all the time, so you need to know, there is an application that can do that for you. Check it out.

Theme Manager for Ubuntu (Natty Narwhal): Check out here a great application to manager theme in Ubuntu.





How to fix problem of incompatibility between GCC 4.6 and Android 2.3 (Gingerbread)

27 05 2011

Hello everybody. Let’s see how we can fix one problem that can happen when you try to compile the Android 2.3 after you already have installed GCC 4.6.

During Android compilation you can receive the following error message:

host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
host SharedLib: libneo_cs (out/host/linux-x86/obj/lib/libneo_cs.so)
host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
make: *** Waiting for unfinished jobs....

To fix that, open a terminal and run (assuming you are in the folder android):

gedit frameworks/base/libs/utils/Android.mk

Change the line:

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)

To:

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive

After that, save the file and recompile the Android again.

That’s it. See you next time.






Changing Google Chrome user agent string in Ubuntu 11.04

24 05 2011

Hello folks. Let’s see today how we can access sites that just accept for example Internet Explorer or where network that just accept the use of Internet Explorer instead of Google Chrome. Many cases, the control of that is made by browser’s user agent string. To change that in Google Chrome, follow the steps below.

  • Press super key and search by System Settings
  • In Personal category, click on Main Menu item. A window will be opened like below.
  • In Menus, select Internet, in Items select Google Chrome/Chromium Web Browser and after click on Properties button . Another window will be opened like below.

  • In command field change the string %U to something like that:

  • --user-agent='Mozilla/4.0 (X11; U; i686; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Ubuntu/11.04 Chrome/11.0.342.1 Safari/533.2'

    For example, in my case, this field is filled up with:

    /usr/bin/chromium-browser %U

    and I have changed to:

    /usr/bin/chromium-browser --user-agent='Mozilla/5.0 (X11; U; i686; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Ubuntu/11.04 Chrome/11.0.342.1 Safari/533.2'

    Restart the Google Chrome and try to access that site you didn’t have access.

    That’s it. See you next time.





    Creating a wallpaper slideshow in Ubuntu 11.04

    23 05 2011

    Hello everybody. If you are that one who like to get changing wallpaper all the time, so you need to know that there is application that can do that for you. It’s called Crebs. With it, you create a image list containing what you would like to show and also it permits to set the transition time between the images.

    Now, let’s install it. Open a terminal and run:

    sudo add-apt-repository ppa:crebs/ppa
    sudo apt-get update
    sudo apt-get install crebs

    To run it, press the super key and search by Create Background Slideshow. See below a screenshot of the application.

    That’s it. See you next time.





    Theme Manager for Ubuntu (Natty Narwhal)

    23 05 2011

    A great application to manager theme in Ubuntu is the GStyle. With it you can download and install full themes, Gtk themes, icons themes between others from gnome-look.org. Also GStyle permit to set a theme for cube mode. To install it, open a terminal and run:

    sudo add-apt-repository ppa:s-lagui/ppa
    sudo apt-get update
    sudo apt-get install gstyle

    To run it, press super key and search by GStyle. Follow below some GStyle screenshot.

    That’s it. See you next time.





    What happend in the last week in Buildall

    22 05 2011

    Creating a Linux Kernel Driver for the Kernel 2.6.38.5 in Ubuntu 11.04: In this post will see how to create and load automatically at boot time a Linux Driver Kernel.

    How to make an ISO from CD/DVD in Ubuntu: Check out here how you can make ISO from CD/DVD using the command dd.

    How to make an ISO from files in Ubuntu 11.04: See here how we can generate an ISO from files.

    Creating a pen drive bootable with multiple Operating Systems in Ubuntu: You are working in your computer and suddenly your system freeze and you restart it but it doesn’t load anymore. Check out here how you can escape of this situation and choosing a Operational System to be loaded.





    Creating a Linux Kernel Driver for the Kernel 2.6.38.5 in Ubuntu 11.04

    21 05 2011

    Hello everybody. Today I will explain how we can write our own driver for Linux. I will use the kernel 2.6.38.5 and you can get more information about how you can download and compile it in Installing Kernel 2.6.38.5 in the Ubuntu 11.04 (Natty Narwhal). However, if you would like to use another kernel version, you will need to download the kernel source through Ubuntu repository (case you have Ubuntu installed) or accessing the site www.kernel.org.

    So, let’s start it. In your home folder, create a folder named MyDriver. Inside of it, create a file named mydriver.c with the following content:

    #include <linux/module.h> // modules
    #include <linux/kernel.h> // KERN_INFO
    #include <linux/init.h>   // macros

    static int __init mydriver_start(void)
    {

      printk(KERN_INFO "***********************************\n");
      printk(KERN_INFO "Loading my first kernel driver...\n");
      printk(KERN_INFO "Welcome to the mydriver\n");
      printk(KERN_INFO "***********************************\n");
      return 0;

    }

    static void __exit mydriver_end(void)
    {

      printk(KERN_INFO "***********************************\n");
      printk(KERN_INFO "Unloading mydriver...\n");
      printk(KERN_INFO "***********************************\n");

    }

    //Defining the function that will be called when the module is loaded
    module_init(mydriver_start)

    //Defining the function that will be called when the module is unloaded
    module_exit(mydriver_end)

    Now, in the same folder create a file named Makefile with the content below:

    obj-m = mydriver.o
    KVERSION = $(shell uname -r)

    all:

      make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules

    clean:

      make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean


    After that, in the terminal, go to directory MyDriver and run:

    make

    This command will compile our driver and will be generated a file called mydriver.ko. So, it’s time to test the driver. Still in the terminal run the command bellow to load it:

    sudo insmod mydriver.ko

    To check if it was loaded, type:

    lsmod

    A list of modules will be displayed. Check if mydriver is in the list. If ok, you can see the message emitted by printk in /var/log/kern.log. To be easier to check this kind of message, open a new tab in the terminal and run:

    tail -f /var/log/kern.log

    Now, unload the module:

    sudo rmmod mydriver.ko

    Check the message emitted in the terminal where we run the command tail. Doing that, you can load and unload mydriver and check the messages in other terminal.
    With the command above we loaded and unloaded the driver manually, but we can leave the Linux does that automatically at boot (load) and shutdown (unload) time. In the terminal, run:

    sudo mkdir /lib/modules/$(uname -r)/kernel/drivers/mydriver
    cd ~/MyDriver
    sudo cp mydriver.ko /lib/modules/$(uname -r)/kernel/drivers/mydriver

    We created a directory named mydriver to the standard paths and copied our driver to this directory. So, to finish, we need to inform the Linux to load it. Open the file /etc/modules with your preferred text editor and add in the end: mydriver. Come back to terminal and run:

    sudo depmod -a

    That command will create a dependency file for loadable modules for the kernel. The command modprobe will use this file to load the right modules.

    To test that, just restart your Linux and check if the module was loaded with the command lsmod and see the log messages in /var/log/kern.log.

    That’s it. See you next time.





    How to make an ISO from CD/DVD in Ubuntu

    17 05 2011

    Hello folks. Differently we have done in How to make a ISO from files in Ubuntu 11.04 where we created a ISO from a directory, here we will do a ISO from a CD/DVD and also will be used the command dd instead of mkisofs. I know that, there are others softwares that can do the same task such as K3b, but I prefer to show this way because we can use that to make some script to automatize many tasks.

    To do that is simple and easy. Put the DVD in the drive, open a terminal and type:

    dd if=/dev/dvd of=dvd.iso

    The command above create a ISO from a DVD, now let’s create for CD:

    dd if=/dev/cdrom of=cd.iso

    Where:

  • if: Specifies the input path. In the cases above were used /dev/dvd and /dev/cdrom.
  • of: Specifies the output path. In the cases above the file that will be generated.
  • That’s it. See you next time.








    Follow

    Get every new post delivered to your Inbox.

    Join 37 other followers