Unspecified Externs Include File

The code file has been specified as different to the main module file.

The code file will contain a set of generated functions for creating your interface, and the main module file will call these functions after calling various standard routines to initialise your X application.

This means that there ought to be an include file which declares the X-Designer generated GUI components in order to bridge together the code file and the main module. The include file ought to contain functional specifications of the X-Designer generated procedures, and declarations for any globally scoped Widgets, Classes, or Data structures in your design.

X-Designer can generate this declarations file for you, and is simply a matter of filling in a text field and setting a toggle in the same page of the Code Generation dialog where you have specified the names of your code and main module files.

You do need to specify that the code and main module files are to include this declarations file: it is not enough to generate the externs, you also need to ensure that an include statement for this file makes its way into the generated source code files.

This is done by displaying the C/C++ options panel, reached by pressing the top right Options button in the Code Generation dialog. The panel so displayed has, amongst other things, a toggle and text field for specifying this #include statement file name. By default, X-Designer should offer you the same name as any generated externs file specified back in the main Code Generation dialog. Simply make sure that the toggle next to the text field is on.

You may well ask why, if X-Designer generates declarations to a given file, do the generated sources do not automatically include this externs file.

This is deliberately not done to leave room for a little flexibility. Just because you can generate external declarations to file externs.h does not mean that the code necessarily has to have #include externs.h: the name of the file to generate, and the name of the file to include, can be different, and you might well do this if you wanted to subclass X-Designer generated classes, or to incorporate definitions of your own to pass as client data to various callbacks. This way you get X-Designer to automatically incorporate your own externs file into the generated sources.

There is an implicit assumption that, if you do specify the include-file differently to the generated-externs-file, your supplied header file should itself include, directly or indirectly, the X-Designer generated externs file.

See also: