3.1.2   Compile and Run on a Native Machine

In this subsection we describe how you can compile the exported C and C++ code using the compiler of your Arm-based platform. We will do this with the aid of the datacode example.

For this, you will need to install HALCON differently on your Arm-based platform:

  1. Install HALCON, wherefore you use the regular Linux installer (the development header files are needed, also for our datacode example we need to include the images), so choose the installation type "full" or "custom".

  2. Change to your installation directory.

Now the Arm-based platform is set up and we can compile the code. Therefore, execute the following steps on your Arm-based platform:

  1. Set the environment variable NATIVE, thus

    export NATIVE=YES
    

  2. Change to the directory $HALCONROOT/examples/arm-linux.

  3. Run make by simply typing

    make
    

    In order that make does not attempt to run HDevelop, the date of the C file datacode.c and the C++ file datacode_cpp.cpp must be newer than the corresponding HDevelop file datacode.hdev.

In order to execute the program, carry out the following steps:

  1. Set the environment variable HALCONIMAGES appropriately.

  2. Execute the program, e.g., datacode_cpp.

  3. You can also execute the example with hrun.