c cpp development environment setup

21
WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 1 von 21 --- Gedruckte Exemplare dieses Dokuments könnten nicht aktuell sein und gelten als ungelenkt. Die Aktualität ist vor der Verwendung zu überprüfen. --- Wachendorff Elektronik GmbH & Co. KG Wachendorff Elektronik C/C++ Development Environment Setup Manual 1 Introduction ........................................................................................................................... 2 1.1 General .......................................................................................................................... 2 1.2 Description..................................................................................................................... 2 1.3 Supplied files ................................................................................................................. 2 1.4 Tips ................................................................................................................................ 2 2 Operating System installation ............................................................................................... 3 2.1 Create a bootable CD or USB stick ............................................................................... 3 2.1.1 Burn ISO image to a CD ......................................................................................... 3 2.1.2 Create a bootable USB stick .................................................................................. 3 2.2 Installation ..................................................................................................................... 4 3 Toolchain and Rootfs Setup ................................................................................................. 8 3.1 Copy files to Ubuntu ...................................................................................................... 8 3.2 Toolchain installation ..................................................................................................... 8 3.3 Rootfs installation .......................................................................................................... 9 3.4 Testing the toolchain ..................................................................................................... 9 4 Development Tools Setup................................................................................................... 11 4.1 Qt and QtCreator ......................................................................................................... 11 4.2 Install the Qt SDK ........................................................................................................ 11 4.3 Configuration ............................................................................................................... 11 4.4 Creating a test project.................................................................................................. 12 5 Summaries and FAQ........................................................................................................... 19 5.1 What to do only once after installing? ......................................................................... 19 5.2 What to do for each new project? ................................................................................ 19 5.3 What to do when I want to develop for another OPUS device?................................... 19 5.4 How to connect and log-in to an OPUS A3? ................................................................ 19 5.5 Where can I find more detailed manuals? ................................................................... 19 5.5.1 Linux and Ubuntu ................................................................................................. 19 5.5.2 Qt .......................................................................................................................... 19 5.5.3 C/C++ ................................................................................................................... 20 5.5.4 Programming for OPUS devices ........................................................................... 20 5.6 How can I configure an application to start automatically when starting the OPUS device? ................................................................................................................................... 20

Upload: easy

Post on 12-Nov-2015

105 views

Category:

Documents


23 download

DESCRIPTION

how to setup your host to developp using C/C++

TRANSCRIPT

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 1 von 21 --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    Wachendorff Elektronik

    C/C++ Development Environment Setup Manual

    1 Introduction ...........................................................................................................................2

    1.1 General ..........................................................................................................................2 1.2 Description.....................................................................................................................2 1.3 Supplied files .................................................................................................................2 1.4 Tips................................................................................................................................2

    2 Operating System installation ...............................................................................................3 2.1 Create a bootable CD or USB stick ...............................................................................3

    2.1.1 Burn ISO image to a CD .........................................................................................3 2.1.2 Create a bootable USB stick ..................................................................................3

    2.2 Installation .....................................................................................................................4 3 Toolchain and Rootfs Setup .................................................................................................8

    3.1 Copy files to Ubuntu ......................................................................................................8 3.2 Toolchain installation.....................................................................................................8 3.3 Rootfs installation ..........................................................................................................9 3.4 Testing the toolchain .....................................................................................................9

    4 Development Tools Setup...................................................................................................11 4.1 Qt and QtCreator .........................................................................................................11 4.2 Install the Qt SDK ........................................................................................................11 4.3 Configuration ...............................................................................................................11 4.4 Creating a test project..................................................................................................12

    5 Summaries and FAQ...........................................................................................................19 5.1 What to do only once after installing? .........................................................................19 5.2 What to do for each new project? ................................................................................19 5.3 What to do when I want to develop for another OPUS device?...................................19 5.4 How to connect and log-in to an OPUS A3?................................................................19 5.5 Where can I find more detailed manuals? ...................................................................19

    5.5.1 Linux and Ubuntu .................................................................................................19 5.5.2 Qt..........................................................................................................................19 5.5.3 C/C++ ...................................................................................................................20 5.5.4 Programming for OPUS devices...........................................................................20

    5.6 How can I configure an application to start automatically when starting the OPUS device? ...................................................................................................................................20

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 2 von 21 --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    1 Introduction 1.1 General

    This manual provides instructions on how to setup a PC or Laptop for developing embedded applications for the Wachendorff OPUS operator panels. This manual concentrates on the OPUS A3 panel, but the installation and setup for OPUS A6 and OPUS RVC are basically the same. 1.2 Description

    The OPUS operating panels run an embedded Linux operating system. To create applications that can run on these devices, a special development system needs to be set up. This devel-opment system consists basically of 3 components:

    A Linux operating system. A toolchain and rootfs which enables one to build applications for the OPUS devices. Development tools that make software development a little easier.

    The operating system can basically be any Linux distribution. This manual uses the Ubuntu distribution because it is easy to setup and maintain. We use the Long-term support version of Ubuntu (10.04). The toolchain consist of cross-compiler and libraries that produce executables that can run on the OPUS devices. Each CPU needs a specialized toolchain to be able to generate binaries that can be interpreted correctly. Specific libraries and header files come in a rootfs archive that represents the file structure of the operating system of the device. 1.3 Supplied files

    ubuntu-10.04.3-desktop-i386.iso o A disk image with the Ubuntu Linux operating system

    tc_arm_gcc-4.4.4-glibc-2.11.1-multilib-1.0.i386.tar.gz o The OPUS A3 toolchain (for BSP version >= 1.0.0)

    rootfs-opusa3-1.0.1.tar.gz o The rootfs of the OPUS A3

    qt-sdk-linux-x86-opensource-2009.04.1.bin o The Qt SDK including QtCreator

    1.4 Tips

    In a Linux terminal shell use the TAB key to auto-complete file names or paths (start typ-ing, then hit TAB for auto completion).

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 3 von 21 --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    2 Operating System installation As operating system we use Ubuntu 10.04 LTS (Long-term support). To install, we need an ISO image to create a bootable CD or USB-stick. You can find ubuntu-10.04.3-desktop-i386.iso ei-ther along these instructions or you can download it here: http://www.ubuntu.com/download/ubuntu/download If you already have a working Ubuntu disk, you can skip chapter 2.1 and continue with chapter 2.2. 2.1 Create a bootable CD or USB stick

    To install Ubuntu to your PC, you need to either create a bootable CD or you can also create a bootable USB-Stick. All instructions for the following and other methods can also be found here: http://www.ubuntu.com/download/ubuntu/download 2.1.1 Burn ISO image to a CD

    2.1.1.1 Windows 7

    Right-Click on ubuntu-10.04.3-desktop-i386.iso Select "Open with -> Windows Disc Image Burner" In the opened window select the CD-Burner drive and insert an empty CD in that drive Click on "burn"

    2.1.1.2 Windows 95 / 98 / ME / 2000 / XP / Server 2003 / Vista: Infra Recorder

    Download and install Infra Recorder, a free and open-source image-burning program. o http://infrarecorder.sourceforge.net/ o Or use any CD-burning tool that is capable of burning ISO images to a CD

    Insert a blank CD in the drive and select Do nothing or Cancel if an autorun dialog box pops up.

    Open Infra Recorder and click the 'Write Image' button in the main screen. o Alternatively you can select the 'Actions' menu, then 'Burn image'.

    Select the ubuntu-10.04.3-desktop-i386.iso file, then click 'Open'. In the dialog box, click 'OK'.

    2.1.2 Create a bootable USB stick

    To create a bootable USB stick, you need the tool Universal USB Installer. It can be downloaded here: http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3 The tool consists only of one window and is easy to use:

    Step 1: Choose Ubuntu 10.04.X from the drop-down list. Step 2: Click browse and select ubuntu-10.04.3-desktop-i386.iso Sep 3: If you dont see the drive letter of your USB stick in the drop-down list, set the

    checkmark in the Show all Drives (USE WITH CAUTION) checkbox. Click Create to create the bootable USB stick.

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 4 von 21 --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    2.2 Installation

    First you have to make sure that your PC or Laptop is configured to boot from CD or USB. Please refer to the user manual of your PC for how to setup the BIOS to boot from external me-dia.

    Insert the CD or USB stick into the PC and switch it on. Make sure that your PC is configured to boot from CD / USB first. After some seconds you can see the Ubuntu logo. Wait. Wait some more until Ubuntu has started and you can see the Installation Dialog

    On the left side of the dialog you can select the preferred language (since this manual describes everything in English, you should select English there).

    Now click on the button Install Ubuntu 10.04.3 LTS.

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 5 von 21 --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    The next dialog lets you choose your time zone. Choose the region you live in from the

    Region list and the corresponding time zone from the Time Zone list. After that click on Forward.

    Now the Keyboard layout dialog appears. Choose your keyboard layout from the list if you know which one fits to your keyboard. If not, select Guess keymap and press the Guess button. Follow the instructions that are shown. After the correct layout has been selected, press the Forward button.

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 6 von 21 --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    Now we have to configure the hard disk for installation. This manual only covers the op-tion to erase the whole disk and use the entire disk. If you are an experienced user, you can also install Ubuntu along with another OS (like Windows), for instructions for that see http://ubuntuguide.org/wiki/Ubuntu:Lucid#Dual-Booting_Windows_and_Ubuntu WACHENDORFF IS NOT RESPONSIBLE FOR ANY DATA LOSS!. Select Erase and use the entire disk. Click on the Forward button. WARNING: If you use this option, you will LOOSE ALL DATA on your hard disk.

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 7 von 21 --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    In the next dialog, a user profile has to be configured. Fill in all required fields with your

    user information. Make sure to set a password and to check the option Require my password to log in. After entering all data, click on the Forward button.

    The next dialog shows a summary of all installation options. Check that information and if you find any errors hit the Back button to go to any previous dialog. If everything is OK, press the Install button.

    Wait until the Installation Complete message appears and hit the Restart Now button.

    Ubuntu will now ask you to remove the disk and close the tray. Please do that and then press Enter on the keyboard. (If you installed from a USB-Stick, remove that also before restart).

    The system will now do a restart. When finished, you can login with the chosen user-name and password.

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 8 von 21 --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    3 Toolchain and Rootfs Setup This manual describes the installation of the OPUS A3 toolchain for the BSP version 1.0.1, the file names of the toolchain and the rootfs may change accordingly with a new release. The tool-chains for the other devices are very similar to install. For the toolchain installation you need the archive files tc_arm_gcc-4.4.4-glibc-2.11.1-multilib-1.0.i386.tar.gz and the rootfs archive rootfs-opusa3-1.0.1.tar.gz. 3.1 Copy files to Ubuntu

    Copy the files tc_arm_gcc-4.4.4-glibc-2.11.1-multilib-1.0.i386.tar.gz and rootfs-opusa3-1.0.1.tar.gz to an USB-Stick or use the supplied CD.

    Insert the USB-Stick / CD into the Linux PC A file browser should pop-up after some seconds showing the two files. Copy the two files to the Desktop.

    (You can use any other directory but this manual refers to the Desktop of the current user)

    Close the file browser when the copy operation has finished. 3.2 Toolchain installation

    The toolchain can be installed anywhere on you Linux PC. A common approach is to install it to /opt.

    Open a terminal (Applications Accessories Terminal). The commands in bold need to be typed in the terminal.

    Change directory to the root directory o cd /

    Extract the toolchain archive o sudo tar xvzf ~/Desktop/tc_arm_gcc-4.4.4-glibc-2.11.1-

    multilib-1.0.i386.tar.gz

    o Enter your password This will extract the contents of the archive to /opt

    You can now find the cross-compiler in /opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin To make the usage of the compiler and other build tools easier, you can add that path to the Linux PATH variable so that the executables can be directly executed without having to use the full path. To do this open the bashrc file in an editor:

    gedit ~/.bashrc

    A text editor will appear now Scroll to the bottom and insert the following line: export PATH=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-

    gnueabi/bin:$PATH Save the file and close the editor. Close all terminals that are open so that the new PATH setting can take effect.

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 9 von 21 --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    3.3 Rootfs installation

    We will install the rootfs in the home directory in a new directory called rootfs. Inside this direc-tory we will create another directory called opus_a3. In the rootfs directory you can later also install the rootfs of other OPUS devices. Instructions:

    Open a terminal (Applications Accessories Terminal) Create a new directory:

    o mkdir rootfs

    Go into that directory o cd rootfs

    Create a new directory o mkdir opus_a3

    Go into that directory o cd opus_a3

    Install the rootfs o sudo tar xvzf ~/Desktop/rootfs-opusa3-1.0.1.tar.gz

    o Enter your password Now the OPUS A3 rootfs is installed in ~/rootfs/opus_a3/rootfs

    3.4 Testing the toolchain

    If the toolchain was successfully installed and works can be tested with the following easy test: Create a file called hello.cpp and open it in an editor:

    o mkdir ~/toolchain_test o cd ~/toolchain_test o gedit hello.cpp &

    Insert the following code

    Compile the code for OPUS A3

    o arm-fsl-linux-gnueabi-g++ -o hello hello.cpp

    Copy the hello executable to an USB stick and insert it in the USB slot of the OPUS A3 Connect to the A3 via serial console and login (see chapter 5.4) Copy the hello executable to the A3

    o cp /disk/usbsda1/hello /opt

    Make sure that the executable can be executed o chmod +x /opt/hello

    Execute it o /opt/hello

    You should see the text Hello A3! printed now.

    #include int main(int, char **) { std::cout

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 10 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 11 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    4 Development Tools Setup 4.1 Qt and QtCreator

    The Qt framework is used on all supported OPUS devices. You can either use any editor you like to create Qt applications manually or you can use the QtCreator IDE to assist you. Some configuration steps are necessary so that QtCreator can be used to develop OPUS ap-plications. 4.2 Install the Qt SDK

    Copy the file qt-sdk-linux-x86-opensource-2009.04.1.bin to a USB-Stick. Insert the USB stick in the Linux PC Copy the file qt-sdk-linux-x86-opensource-2009.04.1.bin to the Desktop Open a terminal

    o Change directory to your Desktop cd ~/Desktop

    o Make sure that the installer can be executed: chmod +x ./qt-sdk-linux-x86-opensource-2009.04.1.bin

    o Run the installer ./qt-sdk-linux-x86-opensource-2009.04.1.bin

    Enter your password Follow the instructions of the installer. You can keep all default settings.

    4.3 Configuration

    Open a terminal and type o sudo ln s ~/rootfs/opus_a3/rootfs/usr/local/Qt /usr/local/Qt

    o enter your password Open QtCreator (Applications Programming QtCreator) Go to Tools -> Options

    In the left tree choose Qt4 QtVersions

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 12 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    o On the right side of the dialog click the + button o Enter QtEmbedded in the Version Name field o In the Path field enter /usr/local/Qt o In the Default Qt Version select QtEmbedded o Press OK button

    4.4 Creating a test project

    Choose File New o In the tree in section Projects select Qt4 GUI Application and Click OK

    o As name enter helloA3, enter a directory to store the new project in Create in

    (or keep the default). Click Next

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 13 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    o Click Next

    o As Class name enter helloA3 and click Next

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 14 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    o Click Finish

    Now the new project was created and some settings need to be done o On the left click on Projects

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 15 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    Select your new project Click on Build Environment Check the option Clear system environment Select the PATH variable and click Edit Enter the following text:

    /usr/local/Qt/bin:/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin:/bin:/usr/bin

    Select Build Steps and enter the following in Additional arguments: QMAKE_CXXFLAGS+=-Wno-psabi

    o On the left click on Edit Double-click on helloA3.pro Insert the following two lines:

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 16 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    LIBS += -L/home/dirk/rootfs/opus_a3/rootfs/usr/lib INCLUDEPATH += -I/home/dirk/rootfs/opus_a3/rootfs/usr/include

    Press CTRL + S to save

    Editing the GUI

    o Double-click on helloA3.ui On the right side select the QMainWindow

    Set the geometry to 480 x 272 (the pixel size of the A3 screen)

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 17 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    Drag a Label to the designer area and double-click it Enter Hello A3! and press Enter On the right property pane, you can select another font and font size Resize the label so that the text fits in.

    Press CTRL + S to save

    Build

    In the lower left corner click on the Build All button

    Now the finished built application should be inside the project directory.

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 18 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    Testing o Copy the helloA3 application to a USB stick o Insert the USB stick into a running OPUS A3 o Connect to the A3 via serial console or using ssh over Ethernet and log in (see

    chapter 5.4). o Copy the application from the USB stick to the /opt directory of the A3

    cp /disk/usbsda1/helloA3 /opt

    o Change directory to /opt cd /opt

    o Set execution permission chmod +x helloA3

    o Run the application ./helloA3 qws

    o You now should see the window displaying Hello A3! on the screen of the A3

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 19 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    5 Summaries and FAQ 5.1 What to do only once after installing?

    When toolchain, rootfs and Qt were installed, QtCreator has to be configured as described in section 4.3.

    o Create a symlink to the devices Qt directory in /usr/local/Qt o Create a new Qt version in QtCreator that points to /usr/local/Qt

    5.2 What to do for each new project?

    For each project the settings described in section 4.4 have to be made: o Change the build environment PATH variable so that Qt binaries, the cross compiler and

    all other binaries can be found by QtCreator o Disable psabi warnings in Build Steps o Edit the .pro file with the link and include pathes to the rootfs

    o LIBS += /usr/lib o INCLUDEPATH += /usr/include

    5.3 What to do when I want to develop for another OPUS device?

    o Install the provided toolchain of the other OPUS device (should be very similar to this manual, see chapter 3.2)

    o Install the provided rootfs of the other OPUS device (should be very similar to this man-ual, see chapter 3.3)

    o Change the softlink pointing to the old rootfs to the new rootfs o sudo rm /usr/local/Qt o sudo ln s ~/rootfs/opus_XX/rootfs/usr/local/Qt

    /usr/local/Qt

    o (make sure that the path matches the new rootfs installation path) o When creating a new project or if you want to use an old one, make sure that the PATH

    variable in the project settings (see chapter 4.4) and the LIBS and INCLUDEPATH set-tings in your .pro file (chapter 4.3) point to the correct (new) paths.

    o QtCreator should now automatically use the other devices Qt version and cross com-piler for building.

    5.4 How to connect and log-in to an OPUS A3?

    See chapter 11.1.2 How can I connect to the serial console of the OPUS A3? of the OPUS_A3_C_CPP_Developer_Guide The login username is: root The password is: opusa3 5.5 Where can I find more detailed manuals?

    5.5.1 Linux and Ubuntu

    o Ubuntu: https://help.ubuntu.com/10.04/index.html o Linux Guide: http://en.wikibooks.org/wiki/Linux_Guide

    5.5.2 Qt

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 20 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    o http://doc.qt.nokia.com/4.5/ 5.5.3 C/C++

    o A lot of books are available about the C/C++ programming languages. o Good C++ reference and documentation: http://www.cplusplus.com/

    5.5.4 Programming for OPUS devices

    Developer guides are available for every OPUS device. Usually they are called OPUS_XX_C_CPP_Developer_Guide.pdf. They contain important information on how to ac-cess the devices hardware (e.g. I/O, keys, video input, etc.) and use the available system dae-mons and libraries (e.g. power management daemon). 5.6 How can I configure an application to start automatically when starting the OPUS

    device?

    See chapter 11.2.3 How can I use own user startup scripts? of the OPUS_A3_C_CPP_Developer_Guide Here is an example start script called 00_myApp placed in /opt/etc/init.d. It will start the application myApp stored in the directory /opt/myAppDirectory #!/bin/sh # # Copyright 2010 Wachendorf Elektronik GmbH & Co. KG # # Stop the running application if [ "$1" == "stop" -o "$1" == "restart" ]; then echo "Stopping myApp: " killall myApp 2>/dev/null fi # Start the application if [ "$1" == "start" -o "$1" == "restart" ]; then echo "Starting myApp: " # System setting export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin export HOME=/root # Touchscreen settings export TSLIB_FBDEVICE=/dev/fb0 export TSLIB_TSDEVICE=/dev/input/ts0 export TSLIB_CONFFILE=/etc/ts.conf export TSLIB_CALIBFILE=/opt/etc/pointercal # if touch wasn't calibrated yet, do calibration if [ ! -f "/opt/etc/pointercal" ]; then mkdir -p /opt/etc ts_calibrate

  • WE_C_CPP_Development_Environment_Setup Datum: 13.01.2012 Seite 21 von --- Gedruckte Exemplare dieses Dokuments knnten nicht aktuell sein und gelten als ungelenkt. Die Aktualitt ist vor der Verwendung zu berprfen. ---

    Wachendorff Elektronik GmbH & Co. KG

    chmod 644 /opt/etc/pointercal fi # application and Qt settings export PATH=/usr/local/Qt/bin:$PATH export POINTERCAL_FILE=/opt/etc/pointercal export QWS_DISPLAY="LinuxFb:mmWidth=95.04:mmHeight=53.856:/dev/fb0" export QWS_SIZE=480x272 export QWS_MOUSE_PROTO=Tslib:/dev/input/ts0 export QWS_KEYBOARD="USB:/dev/input/keyboard0 USB:/dev/input/encoder0" export LD_LIBRARY_PATH=/usr/local/Qt/lib:$LD_LIBRARY_PATH cd /opt/myAppDirectory ./myApp -qws & fi