Thursday, July 29, 2010

What is ifconfig command tells?

What is the minicom? How to use it?

Summary for Installation of Qt/Embedded!

QT 4.6.0 from Sources
Extra Dependencies
(I installed gcc, kernel-headers and GNU Make as dependencies for the VirtualBox Guest Additions, since this is the snapshot I returned to, I don't have to reinstall these)
We know from previous attempts that we need these:
# apt-get install g++
# apt-get build-dep qt4-qmake
then, get it and build it.
$ wget http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.0.tar.gz
$ tar xvfz qt-everywhere-opensource-src-4.6.0.tar.gz
$ cd qt-everywhere-opensource-src-4.6.0
$ ./configure
(about 10 minutes on this VM)
$ make
(about 4 hours on this VM!)
# make install
(and we're at 4.6.0), OpenSSL ("default" for etch - and we're at - OMG! - 0.9.8g - Oct 2007),

How to install Qt/E correctly?

I'm using Ubuntu and I have installed Qt/X11 from qt.nokia.com.

when I install Qt/E I have met the error: XLib test failed after "./configure".

Basic XLib functionality test failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/lolveley/bin/qt-x11-opensource-src-4.5.1/mkspecs/linux-g++.

SOLUTION:
sudo apt-get build-dep qt4-qmake

Tuesday, July 27, 2010

Saturday, July 24, 2010

How to install Qt for Embedded Linux (Qtopia)

How to uncompress tar file?

To uncompress
$ tar zxvf file-name

To compress
$ tar zcvf file-name 'filelist to compress'

-z: gzip processing
-x: extraction
-c: compress
-v: view
-f: tar rile

remember otpion with image of keyboard position z x c v f

Friday, July 23, 2010

What is the curses library?

refer to:
http://wiki.kldp.org/wiki.php/NCURSES-Programming-HOWTO

What is the Qtopia?

Qtopia


GUI App Development Environment for Qtopia

On Linux PC
. Install Qt/X11
. Install Qt/E Library
. Setup Tmake
. Install Qtopia

On Target Board
. Install Qt/E Library
. Setup ARM Tmake
. Install ARM Qtopia

Thursday, July 22, 2010

How to change a file as executable?

chmod a+x file-name

Ubuntu equivalent of Windows’ autoexec.bat

edit /etc/fstab file.

but this method is not working correctly.
when boot mount error occurred.

the following link is same with my wondering.

http://www.mangoorange.com/2007/08/30/ubuntu-equivalent-of-windows-autoexecbat/

Writing your First C++ Program in Eclipse

Step 0: Launch Eclipse
Start Eclipse by running "eclipse.exe". Choose an appropriate directory for your workspace (i.e., where you wish to save your work). If the "welcome" screen shows up, close the "welcome" screen by clicking the "Close" button.

Step 1: Create a new C++ Project
From "File" menu ⇒ New ⇒ Project... ⇒ C++ ⇒ C++ project ⇒ Next ⇒ In "Project Name", enter "Hello". In the "Project Types" box, select "Executable" ⇒ Empty Project. In the "Toolchain" box, select "Cygwin GCC" ⇒ Next ⇒ Finish.

Step 2: Write a C++ Program
Right-click on the "Hello" project (or "src" folder) (or from the "File" menu), select "New" ⇒ Source File ⇒ In "Name", enter "test.cpp" ⇒ Finish.

Enter the following source code in the "test.cpp" editor panel (double-click on "test.cpp" to open the editor panel if necessary).

#include
using namespace std;

int main() {
cout << "Hello, world!" << endl;
}
Note: If error "unresolved inclusion" appears next to #include statement, the "include paths for headers" are not set properly. Right click the project ⇒ Property ⇒ C/C++ General ⇒ Paths and Symbols ⇒ Includes ⇒ GNU C ⇒ Add... ⇒ Enter "$CYGWIN_HOME\usr\include" where $CYGWIN_HOME is the Cygwin installed directory ⇒ GNU C++ ⇒ Add... ⇒ Enter "$CYGWIN_HOME\lib\gcc\i686-pc-cygwin\3.4.4\include\c++. (To find the header paths, do a search on headers such as "stdio.h" and "iostream" under the Cygwin installed folder.)

Step 3: Compile/Build
From the "Project" menu, choose "Build All" to compile and link the program.

Step 4: Run
To run the program, right-click anywhere on the source "test.cpp" (or from the "Run" menu) ⇒ Run As ⇒ Local C/C++ Application ⇒ (if ask, choose Cygwin's gdb debugger) ⇒ Observe the output "Hello, world!" on the "Console" panel.

Note: You should create a new C++ for each of your programming problems.

How to Install Eclipse C/C++ Development Tool (CDT)?

Step 0: Install Cygwin
To use Eclipse for C/C++ programming, you need to first install Cygwin's C/C++ Development Tools (for compiling and debugging C/C++ programs). Read "Cygwin - How to Install". Make sure that you select "gcc", "g++", "gdb", and "make" packages under the "Devel" (Development) category, since these packages are not part of the default installation.

Step 1: Install Eclipse C/C++ Development Tool (CDT)
Two ways to install CDT, depending on whether you have previously installed an Eclipse runtime:

If you have installed "Eclipse for Java Developers" or other Eclipse packages, you could install the CDT plug-in from http://www.eclipse.org/cdt/downloads.php. Follow the installation instructions. (Launch Eclipse ⇒ Help ⇒ Install New Software... ⇒ Add... ⇒ in "Archive...", enter the CDT update site URL, e.g., http://download.eclipse.org/tools/cdt/releases/galileo.)
If you did not install any Eclipse package, you could download "Eclipse IDE for C/C++ Developers" from http://www.eclipse.org/downloads, and unzip the downloaded file into a directory of your choice.

How to install in Ubuntu

$ sudo apt-get install eclipse

after install process you can find eclipse in Program>Developmemnt.

you can also install CDT plug-in.

download cdt-plugin from www.eclipse.org/cdt.
and then click

Wednesday, July 21, 2010

How to see variable with gdb?

Use p command to view indivisual variable and use info xxxx comand to see the values.

$ p variable-name
$ p/format variable-name
$ p variable@size-of-array

$ info locals
$ info variables
$ info registers

$ display vaiable
$ undisplay display_number
$ enable display display-number.
$ disable display display-number.

Tuesday, July 20, 2010

How to set data break point?

Data break point is call watch break point in gdb.

use watch command with variable name like this:

watch [variable-name]

this command have gdb to stop the execution every time variable-name's value is changed.

How to view call stack in gdb?

Use 'bt' command. bt means back trace.

How to break point with gdb?

Use b command with one of the following:

b function_name
b line_number
b filename:function_name
b filename:line_number
b *0xAddress
b line_number if var==0
b +2
b -2

Monday, July 19, 2010

How to use GNU debugger - gdb?

This is the GNU debugger. Usage:

gdb [options] [executable-file [core-file or process-id]]
gdb [options] --args executable-file [inferior-arguments ...]

Options:

--args Arguments after executable-file are passed to inferior
-b BAUDRATE Set serial port baud rate used for remote debugging.
--batch Exit after processing options.
--batch-silent As for --batch, but suppress all gdb stdout output.
--return-child-result
GDB exit code will be the child's exit code.
--cd=DIR Change current directory to DIR.
--command=FILE, -x Execute GDB commands from FILE.
--eval-command=COMMAND, -ex
Execute a single GDB command.
May be used multiple times and in conjunction
with --command.
--core=COREFILE Analyze the core dump COREFILE.
--pid=PID Attach to running process PID.
--dbx DBX compatibility mode.
--directory=DIR Search for source files in DIR.
--epoch Output information used by epoch emacs-GDB interface.
--exec=EXECFILE Use EXECFILE as the executable.
--fullname Output information used by emacs-GDB interface.
--help Print this message.
--interpreter=INTERP
Select a specific interpreter / user interface
-l TIMEOUT Set timeout in seconds for remote debugging.
--nw Do not use a window interface.
--nx Do not read .gdbinit file.
--quiet Do not print version number on startup.
--readnow Fully read symbol files on first access.
--se=FILE Use FILE as symbol file and executable file.
--symbols=SYMFILE Read symbols from SYMFILE.
--tty=TTY Use TTY for input/output by the program being debugged.
--tui Use a terminal user interface.
--version Print version information and then exit.
-w Use a window interface.
--write Set writing into executable and core files.
--xdb XDB compatibility mode.

At startup, GDB reads the following init files and executes their commands:
* system-wide init file: /etc/gdb/gdbinit

Sunday, July 18, 2010

What is ld-linux.so.2?

this name seems to be maded ramdomly. I hate this name because it is difficult to remember. why this name is maded like this?

http://www.ibm.com/developerworks/kr/library/l-shlibs.html

How to use man for manual in linux?

if you want to see the ls command's usage.

$ man ls
$ ls --help

Usually man pages are saved in /usr/man or /usr/share/man.

contents of man page are regular. it consists of name, synopsis, description, example and See Also.

for more information refer to:
http://www.ibm.com/developerworks/aix/library/au-spunix_manpages/index.html

What is different beteen single - and double -- option?

- option is following only one character.
-- is more user friendly option.

for example of man --help
-V, --version both are the same option.

Which optimization option can I choose?

You can use O1, O2, O3, Os.
But I prefer to use Os for size optimization and recommend it to you.

How to enable all of the warning in gcc?

Use -W and -Wall options together.
It is same with Waring level 4 in VisualStudio compiler.

If you want to disable specific waring number you can use -Wno-[warning number to disable].

If you want to disable all of the warning message Use the -w lowcase W option.

How to create C++ code style in gcc compile with no error?

How to create C++ code style in gcc compile with no error?
: use -std=c99 option

you can use C++ style coding like the following

int main()
{
printf("Use C99\n");

int a = 0;
for( int i = 0; i < 10; i++ )
{
printf("i = %d\n");
}
}

Saturday, July 17, 2010

Ubuntu 10.04 Inputting Korean Characters with SCIM

I wanted to find out how to input Korean characters with Ubuntu. At first, I thought it was as easy as going to System> Preferences> Keyboard. I clicked on the Layouts tab and tried to add the Korean keyboard layout. Unfortunately, the Korean keyboard layout is just a regular QWERTY keyboard and does not have any Korean letters at all.

I found a post in ubuntuforums.org that explained how to enable Korean input.

1. Enable Korean language support by going to System> Administration> Language Support. Click on Install / Remove Languages, select Korean from the list and Apply Changes. Select scim as the Keyboard input method system.

2. Go to Applications> Ubuntu Software Center and search for scim-hangul and install Hangul Input Method Engine for SCIM.

3. On my computer SCIM was installed by default, but if not you can install it in the Ubuntu Software Center. It is called SCIM Input Method Setup. After it is installed you can find it under System> Preferences> SCIM Input Method Setup.

4. Restart your computer.

5. Activate SCIM by inputting ctrl + space bar. You should see a floating menu on the bottom right corner and/or a keyboard icon in the upper right corner. Both allow you to switch between Korean and English.

My preferred font for reading Korean text is Baekmuk Dotum and Baekmuk Gulim which are nicely legible. These can be installed through the Ubuntu Software Center by searching for Baekmuk series TrueType fonts. Then in Firefox, you can enable them by going to Edit> Preferences. Select the Content tab and select Advanced and then you can choose the fonts for Korean.

http://newtoubuntu.wordpress.com/2010/07/03/ubuntu-10-04-inputting-korean-characters-with-scim/
How to complile only hello.c with gcc?
: use -c option to say not to run the linker.
: ex) gcc -c hello.c

gcc uses cpp0, cc1, as, collect2.
cpp0 = pre-processor,
cc1 = compiler,
as = assembler,
collect2 = linker.

What is the extension of shared library and static library?
: static library is .a
: shared library is .so
How to change screen resolution of Ubuntu at VritualBox?

: 1. Select Devices>Install Guest Editions
: 2. VBOXADDITIONS_3.2.63112.iso is mounted
: 3. go to the mounted directory and find and double click "autorun.sh" to run in terminal.
: 4. Reboot.