22.01.2015 Views

HDevelop User's Manual

HDevelop User's Manual

HDevelop User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.3. CODE GENERATION FOR C 89<br />

4.3 Code Generation for C<br />

This section describes how to create a HALCON application in C, starting from a program<br />

developed in <strong>HDevelop</strong>.<br />

4.3.1 Basic Steps<br />

4.3.1.1 Program Export<br />

The first step is to export the program using the menu Ð º ËÚ ×. Here, select the language<br />

(C) and save it to file. In UNIX you specify the language by giving the file the extension<br />

“º”. A file will be created that contains the <strong>HDevelop</strong> program as C source code in a procedure<br />

ØÓÒ´µ. This procedure is called in function ÑÒ´µ. Besides the program code, the<br />

file contains all necessary ÒÐÙ instructions. All variables (iconic as well as control) are<br />

declared locally in the procedure ØÓÒ´µ. Iconic variables belong to the class ÀÓØ and<br />

all other variables belong to ÀØÙÔÐ.<br />

Please note, that in the current version the generated C code is not optimized for readability,<br />

yet.<br />

4.3.1.2 Compiling and Linking in Windows NT Environments<br />

The next step is to compile and link this new program. In the Windows NT environment, Visual<br />

C++ is used for the compiling and linking. Example projects can be found in the directory<br />

±ÀÄÇÆÊÇÇ̱ÒÜÑÔÐ×ÒÒ¹ÒØ.<br />

If you want to use Parallel HALCON, you have to include the libraries ÔÖÐÓҺлºÐÐ<br />

and ÔÖÐÓҺлºÐÐ instead of ÐÓҺлºÐÐ and ÐÓҺлºÐÐ in your<br />

project (see the HALCON/C++ User’s <strong>Manual</strong> for more details).<br />

4.3.1.3 Compiling and Linking in UNIX Environments<br />

To compile and link the new program (called e.g. Ø×غ) in the case of UNIX, you can use the<br />

example ÑÐ which can be found in the directory °ÀÄÇÆÊÇÇÌ»ÜÑÔÐ×» by calling<br />

Ñ ÌËÌÈÊÇØ×Ø<br />

Alternatively, you can set the variable ÌËÌ ÈÊÇ in ÑÐ to Ø×Ø and then just type Ñ.<br />

You can link the program to the Parallel HALCON libraries by calling<br />

Ñ ÔÖÐÐÐ ÌËÌÈÊÇØ×Ø<br />

or just type Ñ ÔÖÐÐÐ if you set the variable ÌËÌ ÈÊÇ as described above.<br />

For more details see the HALCON/C User’s <strong>Manual</strong>.<br />

HALCON 6.0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!