Your own C programs that use HALCON operators must include the file HalconC.h, which contains all user-relevant definitions of the HALCON system and the declarations necessary for the C interface. Do this by adding the following command near the top of your C file:
#include "HalconC.h"
Using this syntax, the compiler looks for HalconC.h in the current directory only. Alternatively, you can tell the compiler where to find the file by giving it the -I<pathname> command line flag to denote the include file directory.
To create an application, link two libraries to your program: The library libhalconc.so contains the various components of the HALCON/C interface. libhalcon.so is the HALCON library.
HALCON XL applications: If you want to use HALCON XL, you have to link the libraries libhalconcxl.so and libhalconxl.so instead.
Please take a look at the example makefiles for suitable settings. If you call gmake without further arguments, the example application example1 will be created. To create the other example applications (e.g., example2), call
make example2
You can use the example makefiles not only to compile and link the example programs but also your own programs (called, e.g., test.c) by calling
make test
You can link the program to the HALCON XL libraries by adding XL=1 to the make command, for example:
make test XL=1
To link and run applications under Linux, ensure that the system variable LD_LIBRARY_PATH contains the HALCON library path $HALCONROOT/lib/$HALCONARCH.