Preparing for Compilation of Generated Files

Before compiling your application, be sure the following files have been generated:

Make sure the following options are enabled in the application's build setup:

gen(enumsize, 4),                      
gen(rtti, yes),                        
defaults(xlC_r),                       
lang(nokeyword,"false"),               
lang(nokeyword,"true"),                
lang(nokeyword,"bool"),                
define(IC_LANG_BOOL,0),                
define("IC_TRACE_DEVELOP"),            
link(linkwithsharedlib, yes),          
link(linkwithmultithreadlib, yes),     
link(map, no),                         
link(padding, no),                     
incl(searchpath,".")                   

If you intend to compile parts into separate runtime or interface libraries, remember to set the appropriate targets in the application's build setup. For complete examples of build setups for executable files, runtime libraries, and interface libraries, see the OASearch sample.

In OS/2 and Windows, part files (.vbf) are automatically recognized as a valid source format in the IDE; it is from these that VisualAge reads dependency information. In AIX, however, you must use the generated .cpp file names; you must also explicitly include any system runtime libraries that must be linked. Here is a portion of the AIX build setup for the OASearch application, found in oasearch.icc. Note the specification of the runtime library for a custom visual part, OAMorphableSpinButton, which is found in the current build directory.

        "skill.cpp",	     
        "skillb.cpp"      
 source "pthread.h"       
 source "./oamorph.a"     
                          
 source "libvacbase.a"    
 source "libvacui.a"      
 source "libvacvgui40.a"  
 source "libvacvngui40.a" 
 source "libvacgraph2d.a" 

If you intend to build an interface library for custom visual parts in AIX, you must write a small amount of code by hand and add the new code file to your build setup. (You need one of these code files for each interface library you plan to build, regardless of the number of parts to be included.) This is not necessary for OS/2 or Windows; in these cases, build the interface library the same way you would build the runtime library for the part. Here is the AIX interface code for the OAMorphableSpinButton part, found in oamorph.cp:

#include <iavlbase.h>
#if defined (IC_MOTIF)
//
// Add one extern statement for each custom visual part.
// Get the name of the primitive table from the interface source file
//   that is generated for the part.
// 
extern EsPrimitiveTable (OAMorphableSpinButtonTable);
//
// You can name this new primitive table anything you want,
//   but the name must be unique to your application.
//
EsDefinePrimitiveTable(OAMorph)
//
// Add one EsSubTable statement for each custom visual part.
// Use the same primitive table name as you did in the extern statement.
// 
EsSubTable (OAMorphableSpinButtonTable)
EsEndPrimitiveTable
#endif

In AIX, the IDE does not recognize .cp as a valid source type, so you must explicitly declare it in the build setup for the interface library. Note that the name of the AIX build target ends in .w; Visual Builder assumes this for all interface libraries in AIX. Also note the correspondence between the primitive table created in the previous code and one link option that follows. Here is the AIX build setup for OAMorphableSpinButton, found in oamorphw.icc:

option                                                   
       gen(enumsize, 4),                                 
       gen(rtti, yes),                                   
       defaults(xlC_r),                                  
       lang(nokeyword,"false"),                          
       lang(nokeyword,"true"),                           
       lang(nokeyword,"bool"),                           
       define(IC_LANG_BOOL,0),                           
       define("IC_TRACE_DEVELOP"),                       
       link(linkwithsharedlib, yes),                     
       link(linkwithmultithreadlib, yes),                
       link(map, yes),                                   
       link(padding, no),                                
       link(sharedLibPriority,-2147482557),              
       link(exportAll),                                  
       link(entry,OAMorph),                              
       incl(searchpath,".")                              
                                                         
{                                                        
                                                         
                                                         
      target type(shr) "oamorphw.w"                      
      {                                                  
         source type(cpp) "oamorphw.cp"                  
         source type(cpp) "oamrfbtn.cp"                  
     	 source "libvacvifbase.a"                     
         source "libvacbase.a"                           
     	 source "libvacui.a"                               
         source "./oamorph.a"                            
                                                         
      }                                                  
                                                         
}                                                        


Related procedures
Generating Code
Changing a Build Setup
Debugging Connections