1.2.3   How to Create and Use a HALCON Package

In summary, the following steps are necessary to create a HALCON package with the name package integrating new operators into the HALCON system. As noted in section “Packages and HALCON XL”, to create a HALCON XL package, you must create a second version of the libraries. A detailed description of the steps can be found in the referenced sections of this manual:

  1. Description of the new operator(s) in one or more def-files (cf. chapter “Operator Description (def-file)”). We recommend to place these files in the package subdirectory def.
  2. Creation of a library (called package) containing the supply procedures in C and the corresponding action procedures (cf. chapters “Style Guide for Programming” to chapter “Special Routines for Typical Supply Procedures”). This library has to be placed in the package subdirectory lib/$HALCONARCH (Linux/macOS) or bin\%HALCONARCH% (Windows).
  3. Creation of a library containing the language-dependent operator interfaces (packagec, packagecpp, packagex, and packagedotnet) based on the def-files with the help of hcomp (cf. section “The HALCON Compiler hcomp”). These libraries have to be placed in the subdirectory lib/$HALCONARCH (C, C++ under Linux/macOS) or bin\%HALCONARCH% (C, C++ under Windows) or bin\dotnet of the package.
  4. Generation of files for online access to the knowledge base with the help of hcomp. These files are used, e.g., by HDevelop. They have to be placed in the subdirectory help of the package.
  5. Generating the HTML reference files with the help of hcomp (optional). The generated files have to be placed in the subdirectory doc\html\reference of the package.
  6. Generating PDF manuals with the help of hcomp (optional).
  7. Extension of the package list in the environment variable HALCONEXTENSIONS by the complete file path of the new package, e.g.,
    %HALCONEXAMPLES%\extension_package\halconuser
    For some platforms additional environment variables have to be modified, see section “Installing a HALCON Package” and section “Additional Information for Specific Platforms”.
  8. Linking of the generated libraries together with the HALCON library to the image analysis application (cf. chapter “Creating a New HALCON Package”). For this, you have to modify additional environment variables, depending on the operating system (see below). Please note, that HDevelop is able to access the new operators dynamically without linkage.