The previous sections summarized the generation of HALCON extensions in general. This section contains additional information for specific platforms. The main differences concern the name handling and the generation of shared libraries / DLLs.
In order to activate a package, its complete path, e.g.
%HALCONEXAMPLES%\extension_package\halconuser
must be included in the environment variable HALCONEXTENSIONS. In the Windows version the package paths in HALCONEXTENSIONS are separated by semicolons.
Note, that DLLs must be stored in the subdirectory bin\%HALCONARCH% of the package, the corresponding libraries in the subdirectory lib\%HALCONARCH%.
To create the libraries packagexl.dll and packagexl.lib for HALCON XL, the corresponding object files compiled with the define /DHC_LARGE_IMAGES must be linked to the HALCON XL library halconxl.lib instead of halcon.lib.
To create the libraries packagecxl.dll and packagecxl.lib for HALCON XL, the corresponding object file compiled with the define /DHC_LARGE_IMAGES must be linked to the HALCON XL version of the libraries, i.e., packagexl.lib, halconcxl.lib, and halconxl.lib.
To create the libraries packagecppxl.dll and packagecppxl.lib for HALCON XL, the corresponding object files compiled with the define /DHC_LARGE_IMAGES must be linked to the HALCON XL version of the libraries, i.e., packagexl.lib, halconcppxl.lib, and halconxl.lib.
To create the assembly packagedotnetxl.dll for HALCON XL, the source file HDOTNETpackage.cs must be compiled with the compiler flag /define:HC_LARGE_IMAGES.
To create a HALCON XL version of your application, just use the HALCON XL version of the libraries (e.g., packagecxl.lib and halconcxl.lib in case of a C application).
To be able to link the package DLL to your application program, the complete DLL file path of the new package, e.g.,
%HALCONEXAMPLES%\extension_package\halconuser\bin\%HALCONARCH%
has to be added to the environment variable PATH. This is also true for .NET applications.
Do not copy a package DLL into the Windows system directories, as it would be loaded twice in this case!
If you encounter program crashes, check the stack size allocated by your application. A stack size of 6 - 8 MB is recommended.
The directory %HALCONEXAMPLES%\extension_package\halconuser contains two example makefiles: makefile.win creates the example package halconuser, both for standard HALCON and for HALCON XL. makefile_testprog.win creates the example applications based on the package halconuser, again for both HALCON versions. You start the making process by calling
nmake -f makefile.win
and
nmake -f makefile_testprog.win
from the root directory of the package. Both makefiles include the file make.%HALCONARCH%, which sets platform-dependent variables.
Both makefiles include the file make.dotnet, which sets variables for the C# compiler.
Note that you can create a debug version by calling the makefile as follows:
nmake -f makefile.win STATE=debug
By default, a release version is created, which would correspond to calling nmake with STATE=release.
In order to activate a package, its complete path, e.g.
$HALCONEXAMPLES/extension_package/halconuser
must be included in the environment variable HALCONEXTENSIONS. In the Linux version the package paths in HALCONEXTENSIONS are separated by colons. Please see also the comments on installing a HALCON package on a Linux system in section “Additional Information for Linux”.
To create the library libpackagexl.so for HALCON XL, the corresponding object files compiled with the define -DHC_LARGE_IMAGES must be linked.
To create the library libpackagecxl.so for HALCON XL, the corresponding object file compiled with the define -DHC_LARGE_IMAGES must be linked to the HALCON XL version of the operator library, i.e., libpackagexl.so.
To create the library libpackagecppxl.so for HALCON XL, the corresponding object files compiled with the define -DHC_LARGE_IMAGES must be linked to the HALCON XL version of the operator library, i.e., libpackage.so.
To create the assembly packagedotnetxl.dll for HALCON XL, the source file HDOTNETpackage.cs must be compiled with the compiler flag /define:HC_LARGE_IMAGES.
Furthermore, you must add the package library subdirectory lib/$HALCONARCH to the environment variable LD_LIBRARY_PATH.
To create a HALCON XL version of your application, just use the HALCON XL version of the libraries (e.g., libpackagexl.so, libpackagecxl.so, libhalconxl.so, and libhalconcxl.so in case of a C application).
The directory $HALCONEXAMPLES/extension_package/halconuser contains two example makefiles: makefile creates the example package halconuser, both for standard HALCON and for HALCON XL. makefile_testprog creates the example applications based on the package halconuser, again for both HALCON versions. Please note that the makefiles only work correctly with gmake! You must call gmake it from the root directory of the package.
Both makefiles include the file make.$HALCONARCH, which sets platform-dependent variables.
Note that the .NET assemblies are not automatically created by the makefiles. To create them, add dotnet to your call to make, e.g.,
gmake -f makefile dotnet
Both makefiles include the file make.dotnet, which sets variables for the C# compiler.
Note that you can create a debug version by calling the makefile as follows:
gmake -f makefile STATE=debug
By default, a release version is created, which would correspond to calling gmake with STATE=release.