Help with moving MDL application to Ustn Connect - LinkageHeader structure not being found

Hello Everyone,

I am having trouble compiling the MT file to the R file. Below is the message from the BMAKE

The line number 40 in the .H file is "LinkageHeader lnkHdr"

[== Building C:\...\<appname>Linktyp.r, (C:\...\<appname>Linktyp.mt) ==]
rsctype @C:\...\AppData\Local\Temp\Bentley\MicroStationSDK\objects\make.opt
MicroStation Type Resource File Generator 03.17.02
C:\...\<appname>Attr.h(40) : error: bad struct/union definition: expected type
C:\...\<appname>Attr.h(40) : error: expected ,, got linkHdr
BMAKE: call trace
    line:   84, C:\...\<appname>.mke
Mon Apr 22 15:26:07 2019, elapsed time: 0:02

typedef struct userDataHeader
{
    LinkageHeader    linkHdr;
    DSIDataHeader    dsiHdr;
} UserDataHeader;

What Include file or update do I need to make so that the MT file can be compiled to .r file

Thanks

Peter

Parents
  • What Include file or update do I need to make so that the MT file can be compiled to .r file

    Ask yourself the reason for the .mt file.  It contains very little except some #includes and the publishStructures directive.  It's job is to convert a C struct to a binary type interpretation stored in a .rsc file.  The type interpretation data is used by the Dialog Manager when passing information between your app. variables and your dialog items.  When the Dialog Manager sees "MyStruct.myVariable" in a dialog item access string it can figure out what type of data is in use and how to transfer data between that dialog item and your app. variable.

    The #includes are straightforward: the circuit example .mt has this...

    #include <RmgrTools/Tools/datadef.r.h>
    #include "circuitcomp.h"
    

    The first includes common Bentley definitions and the second includes the circuit app's own struct definitions...

    typedef struct batteryinfo
        {
        ...
        }BatteryInfo;
    
    typedef struct wireinfo
        {
        ...
        }WireInfo;
    
    typedef struct lightinfo
        {
        ...
        }LightInfo;
    
    typedef struct circuitinfo
        {...
        } CircuitInfo;    
    

    The type resource compiler has all the information it needs to convert those struct definitions in the header file to type resource definitions.  Other files, such as C++ implementation modules, can use those same structure definitions.

    What Include file or update do I need to make so that the MT file can be compiled to .r file

    Create a UserDataHeader.r.h file.  Write the struct definition in that file.  #include only those headers required to make it a valid definition.  Include UserDataHeader.r.h in your .mt file.  Include UserDataHeader.r.h in the C++ files that need it.

     
    Regards, Jon Summers
    LA Solutions

Reply
  • What Include file or update do I need to make so that the MT file can be compiled to .r file

    Ask yourself the reason for the .mt file.  It contains very little except some #includes and the publishStructures directive.  It's job is to convert a C struct to a binary type interpretation stored in a .rsc file.  The type interpretation data is used by the Dialog Manager when passing information between your app. variables and your dialog items.  When the Dialog Manager sees "MyStruct.myVariable" in a dialog item access string it can figure out what type of data is in use and how to transfer data between that dialog item and your app. variable.

    The #includes are straightforward: the circuit example .mt has this...

    #include <RmgrTools/Tools/datadef.r.h>
    #include "circuitcomp.h"
    

    The first includes common Bentley definitions and the second includes the circuit app's own struct definitions...

    typedef struct batteryinfo
        {
        ...
        }BatteryInfo;
    
    typedef struct wireinfo
        {
        ...
        }WireInfo;
    
    typedef struct lightinfo
        {
        ...
        }LightInfo;
    
    typedef struct circuitinfo
        {...
        } CircuitInfo;    
    

    The type resource compiler has all the information it needs to convert those struct definitions in the header file to type resource definitions.  Other files, such as C++ implementation modules, can use those same structure definitions.

    What Include file or update do I need to make so that the MT file can be compiled to .r file

    Create a UserDataHeader.r.h file.  Write the struct definition in that file.  #include only those headers required to make it a valid definition.  Include UserDataHeader.r.h in your .mt file.  Include UserDataHeader.r.h in the C++ files that need it.

     
    Regards, Jon Summers
    LA Solutions

Children