Skip to content

Creating and using HALCON packages🔗

Once the new operators have been described in DEF files and implemented (supply and action procedures) a couple of dynamic objects must be created (DLLs in Windows, shared libraries in Linux environments).

Important

Never change the name of a package or the corresponding names of the libraries/DLLs contained in a package.

These names are encoded within the libraries. If you change the names, this information will not match any longer, and the loader of the operating system will fail to open the dynamic libraries.

If you want to rename a package, create the libraries/DLLs again.

General workflow when creating an extension package🔗

More Info

For a more detailed description, see also Creating HALCON packages step by step.

In summary, the following steps are necessary to create a HALCON package with the name package integrating new operators into the HALCON system. A detailed description of the steps can be found in the referenced sections.

As noted in Packages and HALCON XL, to create a HALCON XL package, you must create a second version of the libraries.

  1. Description of the new operator(s) in one or more DEF files (see Describing operators (DEF files)). We recommend placing 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 (see Style guide for programming to Special routines for typical supply procedures). This library has to be placed in the package subdirectory lib/$HALCONARCH (Linux) 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 (see The HALCON compiler hcomp). These libraries have to be placed in the subdirectory lib/$HALCONARCH (C, C++ under Linux) 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 Installing extension packages and Additional information for specific platforms.

  8. Linking of the generated libraries together with the HALCON library to the image analysis application (see Creating a new HALCON package). For this, you have to modify additional environment variables, depending on the operating system. HDevelop is able to access the new operators dynamically without linkage.