Development with Eclipse/ru

From Openmoko

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
{{Languages| Development with Eclipse}}
 
{{Languages| Development with Eclipse}}
Графические приложения Openmoko снованы на гноме. Их легко создавать, запускать и отлаживать н а десктопе, загружать в мобильный телефон только на финальной стадии отладки. Используя мобильный телефон, возможно использовать экран, клавиатуру и мышь десктопа, и это работает. This article describes instructions for Debian, but they will likely work with any non broken Linux distribution.
+
Графические приложения Openmoko снованы на среде Gnome. Их легко создавать, запускать и отлаживать как программы для настольных ПК или загружать в мобильный телефон только на финальной стадии отладки. Используя мобильный телефон, можно использовать экран, клавиатуру и мышь настольного комьютера, и это работает. Данная статья предоставляет инструкции для Debian, но они подходят для любых (не сломанных) Linux-дистрибутивов.
  
Eclipse поддерживает C/C++ development plug-in. Вам может понадобиться обновление Eclipse, этот плагин и возможно обновление пакета разработчика GTK. The easiest way to get the simple application running is to create the managed C project and add `pkg-config --cflags --libs gtk+-2.0` both to the compiler options and to linker flags. After that, go to [http://library.gnome.org/devel/gtk-tutorial/stable/ GTK tutorial] and try, using it, to compose a simple application.
+
Eclipse включает в себя модуль для разработки на C/C++. Вам необходима последняя версия Eclipse, плагин для C/C++ и, возможно, обновление пакета разработчика GTK. Самый лёгкий способ заставить простое приложение выполняться - это создать проект C и добавить в флаги компилятора и линковщика флаги `pkg-config --cflags --libs gtk+-2.0`. После этого посетите страницу [http://library.gnome.org/devel/gtk-tutorial/stable/ GTK tutorial] и, следуя этим инструкциям, создайте простое приложение.
  
This approach not only shortens development cycle from minutes to seconds, but also allows to use the Eclipse debugger for C development, stepping through the code and watching variables.
+
Данное решение не только сокращает время разработки, но также позволяет использовать отладчик Eclipse для разработки на C.
  
Для выполнения на одном мобильном телефоне вам понадобится компилирование проекта из исходных файлов с использованием Openmoko toolchain. As all surroundings of these files for Eclipse and Openmoko project are not the same, the most straightforward approach is just to set two development environments and put the symbolic links of the source files into the Openmoko project directory.
+
Исполняемый файл для мобильного телефона создаётся из тех же самых исходных кодов, используя средства разработки Openmoko. Так как процессы сборки под настольный компьютер и под Openmoko различиаются, самым лучшим вариантом является создание двух окружений разработки и создание символических ссылок для них.
  
 
After producing the Openmoko executable, it may be reasonable to try it via X, using the keyboard, mouse and screen of the desktop computer. All you need is to use the  -X option in the ssh command when you log in into the connected mobile phone. After that, you should be able to run the application inside the phone but have its X window on a screen of the desktop machine. This way you can check the actual execution speed and have access to the mobile phone devices that are not present on PC.
 
After producing the Openmoko executable, it may be reasonable to try it via X, using the keyboard, mouse and screen of the desktop computer. All you need is to use the  -X option in the ssh command when you log in into the connected mobile phone. After that, you should be able to run the application inside the phone but have its X window on a screen of the desktop machine. This way you can check the actual execution speed and have access to the mobile phone devices that are not present on PC.
Line 115: Line 115:
  
 
Create a project with properties as mentioned above.
 
Create a project with properties as mentioned above.
Для компилирования вашего проекта вызовите терминал в Project-Folder и введите там  
+
Для компилирования вашего проекта вызовите терминал в Project-Folder и введите там
 
qmake-qt4 -project
 
qmake-qt4 -project
 
qmake-qt4
 
qmake-qt4

Revision as of 00:31, 6 November 2008

Графические приложения Openmoko снованы на среде Gnome. Их легко создавать, запускать и отлаживать как программы для настольных ПК или загружать в мобильный телефон только на финальной стадии отладки. Используя мобильный телефон, можно использовать экран, клавиатуру и мышь настольного комьютера, и это работает. Данная статья предоставляет инструкции для Debian, но они подходят для любых (не сломанных) Linux-дистрибутивов.

Eclipse включает в себя модуль для разработки на C/C++. Вам необходима последняя версия Eclipse, плагин для C/C++ и, возможно, обновление пакета разработчика GTK. Самый лёгкий способ заставить простое приложение выполняться - это создать проект C и добавить в флаги компилятора и линковщика флаги `pkg-config --cflags --libs gtk+-2.0`. После этого посетите страницу GTK tutorial и, следуя этим инструкциям, создайте простое приложение.

Данное решение не только сокращает время разработки, но также позволяет использовать отладчик Eclipse для разработки на C.

Исполняемый файл для мобильного телефона создаётся из тех же самых исходных кодов, используя средства разработки Openmoko. Так как процессы сборки под настольный компьютер и под Openmoko различиаются, самым лучшим вариантом является создание двух окружений разработки и создание символических ссылок для них.

After producing the Openmoko executable, it may be reasonable to try it via X, using the keyboard, mouse and screen of the desktop computer. All you need is to use the -X option in the ssh command when you log in into the connected mobile phone. After that, you should be able to run the application inside the phone but have its X window on a screen of the desktop machine. This way you can check the actual execution speed and have access to the mobile phone devices that are not present on PC.

Eclipse allows to add the custom builder to the project. These builders can be either Ant scripts or the executable shell scripts. These possibilities can be used to force the Openmoko toolchain to produce the phone executable without leaving the Eclipse IDE.

Contents

Установка конфигурации создания Freerunner

  1. установите Toolchain
  2. откройте 'Properties' для вашего проекта C или C++
  3. выберите 'C/C++ Build'->'Tool Settings'
  4. Кликните на 'Configuration'->'Manage' и создайте новую конфигурацию например. Freerunner (скопируйте настройки с конфигурации 'Relase' )
  5. измените GCC C||C++||Assembler Compiler command на /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc||g++||as
  6. измените GCC Linker Command на /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc (g++ для проектов C++)
  7. идите 'Build Steps' и добавьте ". /usr/local/openmoko/arm/setup-env" к 'Pre-build step'
  8. щелкните на Ok и выберите 'Freerunner' в 'Active Build Configuration' для вашего проекта

Поправки для Eclipse Ganymed (3.4)

There are three places where you have to change settings as above in Project Properties -> C/C++ Build -> Settings -> Tool Settings

  1. GCC C Compiler -> Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc
  2. GCC C Linker -> Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc
  3. GCC Assembler -> Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc||g++||as

--Perty 20:22, 18 September 2008 (UTC)



вы можеет скопировать свои бинарники на Freerunner через добавление команды Post-Build в 'Build Steps' так.

scp ${имя_проекта} root@neo:/home/root/dev_app/

или вы можете запустить ваше приложение на Freerunner добавив в конфигурацию Run

C/C++ Application: /usr/bin/ssh Arguments: root@neo "cd dev_app && DISPLAY=:0 ./${project_name}"

--PipBoy2000 22:30, 9 September 2008 (UTC)

Настройка Eclipse для разработки с Qt4

Настройка Environment с Libraries

  • Установите Eclipse с C/C++ development plug-in
  • Добавьте Anstrom Repository в Host-toolchain и также FreeRunner
    • Добавьте Anstrom Repository в Host-toolchain:

echo arch base 50 >> /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/etc/opkg.conf echo src/gz base http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base >> /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/etc/opkg.conf

и тогда .. opkg-target update opkg-target install qt4-x11-free opkg-target install qt4-x11-free-dev qt4-designer qt4-assistant

opkg update opkg install qt4-x11-free

Конфигурирование проекта Eclipse

Project - right click - Properties --> C/C++ Build -- Tab "Tool Settings"

Конфигурация: Debug

  • GCC c++ compiler -> Directories --- add

/usr/include/qt4 /usr/include/qt4/QtGui

  • GCC C++ Linker -> Libraries ---add
    • Libraries (-l): QtCore and QtGui
    • Library search path (-L): /usr/lib

Конфигурация: Freerunner

Project - right click - Properties --> C/C++ Build -- Tab "Tool Settings"

Создаем конфигурацию "Freerunner": кликнув 'Configuration'->'Manage' и создав новую конфигурацию например Freerunner (скопируйте настройки из конфигурации 'Relase')

  • GCC C++ Compiler
    • Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/g++
  • GCC C++ Compiler -> Directories

/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/qt4/QtCore /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/qt4/QtGui /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/qt4 /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/c++/4.1.2/arm-angstrom-linux-gnueabi /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/c++/4.1.2 /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/c++/4.1.2/backward

  • GCC C++ Linker
    • Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/g++
  • GCC C++ Linker -> Libraries --- add
    • Libraries (-l): QtCore and QtGui
    • Library search path (-L): /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/lib
  • GCC Assembler
    • Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/as

перейдем к закладке 'Build Steps' и добавим ". /usr/local/openmoko/arm/setup-env" к 'Pre-build step'

workaround to deal with .ui файлы с Qt-Designer

mayby somody has a better solution please correct!!

Create a project with properties as mentioned above. Для компилирования вашего проекта вызовите терминал в Project-Folder и введите там qmake-qt4 -project qmake-qt4 make и теперь собирайте ваш проект с Eclipse Configuration "Freerunner"

Personal tools

Графические приложения Openmoko снованы на гноме. Их легко создавать, запускать и отлаживать н а десктопе, загружать в мобильный телефон только на финальной стадии отладки. Используя мобильный телефон, возможно использовать экран, клавиатуру и мышь десктопа, и это работает. This article describes instructions for Debian, but they will likely work with any non broken Linux distribution.

Eclipse поддерживает C/C++ development plug-in. Вам может понадобиться обновление Eclipse, этот плагин и возможно обновление пакета разработчика GTK. The easiest way to get the simple application running is to create the managed C project and add `pkg-config --cflags --libs gtk+-2.0` both to the compiler options and to linker flags. After that, go to GTK tutorial and try, using it, to compose a simple application.

This approach not only shortens development cycle from minutes to seconds, but also allows to use the Eclipse debugger for C development, stepping through the code and watching variables.

Для выполнения на одном мобильном телефоне вам понадобится компилирование проекта из исходных файлов с использованием Openmoko toolchain. As all surroundings of these files for Eclipse and Openmoko project are not the same, the most straightforward approach is just to set two development environments and put the symbolic links of the source files into the Openmoko project directory.

After producing the Openmoko executable, it may be reasonable to try it via X, using the keyboard, mouse and screen of the desktop computer. All you need is to use the -X option in the ssh command when you log in into the connected mobile phone. After that, you should be able to run the application inside the phone but have its X window on a screen of the desktop machine. This way you can check the actual execution speed and have access to the mobile phone devices that are not present on PC.

Eclipse allows to add the custom builder to the project. These builders can be either Ant scripts or the executable shell scripts. These possibilities can be used to force the Openmoko toolchain to produce the phone executable without leaving the Eclipse IDE.

Установка конфигурации создания Freerunner

  1. установите Toolchain
  2. откройте 'Properties' для вашего проекта C или C++
  3. выберите 'C/C++ Build'->'Tool Settings'
  4. Кликните на 'Configuration'->'Manage' и создайте новую конфигурацию например. Freerunner (скопируйте настройки с конфигурации 'Relase' )
  5. измените GCC C||C++||Assembler Compiler command на /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc||g++||as
  6. измените GCC Linker Command на /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc (g++ для проектов C++)
  7. идите 'Build Steps' и добавьте ". /usr/local/openmoko/arm/setup-env" к 'Pre-build step'
  8. щелкните на Ok и выберите 'Freerunner' в 'Active Build Configuration' для вашего проекта

Поправки для Eclipse Ganymed (3.4)

There are three places where you have to change settings as above in Project Properties -> C/C++ Build -> Settings -> Tool Settings

  1. GCC C Compiler -> Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc
  2. GCC C Linker -> Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc
  3. GCC Assembler -> Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc||g++||as

--Perty 20:22, 18 September 2008 (UTC)



вы можеет скопировать свои бинарники на Freerunner через добавление команды Post-Build в 'Build Steps' так.

scp ${имя_проекта} root@neo:/home/root/dev_app/

или вы можете запустить ваше приложение на Freerunner добавив в конфигурацию Run

C/C++ Application: /usr/bin/ssh Arguments: root@neo "cd dev_app && DISPLAY=:0 ./${project_name}"

--PipBoy2000 22:30, 9 September 2008 (UTC)

Настройка Eclipse для разработки с Qt4

Настройка Environment с Libraries

  • Установите Eclipse с C/C++ development plug-in
  • Добавьте Anstrom Repository в Host-toolchain и также FreeRunner
    • Добавьте Anstrom Repository в Host-toolchain:

echo arch base 50 >> /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/etc/opkg.conf echo src/gz base http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base >> /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/etc/opkg.conf

и тогда .. opkg-target update opkg-target install qt4-x11-free opkg-target install qt4-x11-free-dev qt4-designer qt4-assistant

opkg update opkg install qt4-x11-free

Конфигурирование проекта Eclipse

Project - right click - Properties --> C/C++ Build -- Tab "Tool Settings"

Конфигурация: Debug

  • GCC c++ compiler -> Directories --- add

/usr/include/qt4 /usr/include/qt4/QtGui

  • GCC C++ Linker -> Libraries ---add
    • Libraries (-l): QtCore and QtGui
    • Library search path (-L): /usr/lib

Конфигурация: Freerunner

Project - right click - Properties --> C/C++ Build -- Tab "Tool Settings"

Создаем конфигурацию "Freerunner": кликнув 'Configuration'->'Manage' и создав новую конфигурацию например Freerunner (скопируйте настройки из конфигурации 'Relase')

  • GCC C++ Compiler
    • Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/g++
  • GCC C++ Compiler -> Directories

/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/qt4/QtCore /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/qt4/QtGui /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/qt4 /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/c++/4.1.2/arm-angstrom-linux-gnueabi /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/c++/4.1.2 /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/c++/4.1.2/backward

  • GCC C++ Linker
    • Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/g++
  • GCC C++ Linker -> Libraries --- add
    • Libraries (-l): QtCore and QtGui
    • Library search path (-L): /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/lib
  • GCC Assembler
    • Command: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/as

перейдем к закладке 'Build Steps' и добавим ". /usr/local/openmoko/arm/setup-env" к 'Pre-build step'

workaround to deal with .ui файлы с Qt-Designer

mayby somody has a better solution please correct!!

Create a project with properties as mentioned above. Для компилирования вашего проекта вызовите терминал в Project-Folder и введите там qmake-qt4 -project qmake-qt4 make и теперь собирайте ваш проект с Eclipse Configuration "Freerunner"