I cannot compile the mdl project.

I am totally new to the MDL development. I tried to compile an MDL project that was implemented by my colleague (The project was compiled fine on his computer), and here is the error:

Bentley Systems Make Utility. Version 08.11.00.06, Sep  5 2007
Mon Apr 11 11:35:07 2011

[== Building C:\Test\MicroStation\mdl\MDLassetID\work\assetid.mo, (C:\Test\MicroStation\mdl\MDLassetID\assetid.mc) ==]
C:\Bentley\Program\Microstation\mdl\bin\mcomp @C:\Bentley\Program\MicroStation\mdl\objects\make.opt
MicroStation Development Language Compiler 08.05.02
C:\Bentley\Program\MicroStation\mdl\include.mc: can't open
No such file or directory
BMAKE: call trace
    line:   51, C:\Test\MicroStation\mdl\MDLassetID\AssetID.mke

I really have no idea where this include.mc come from.

The make file:

#----------------------------------------------------------------------
#
#   MDL Make File
#
#   Current Revision:
#   $Workfile:   SetDetail.mke  $
#   $Revision:
#
baseDir =      $(_MakeFilePath)
objectDir  = $(baseDir)work/
incDir = $(baseDir)

%ifdef BSI
%include $(MS)/include/publish/mdl.mki
%else
%include $(MS)/mdl/include/mdl.mki
%endif

#----------------------------------------------------------------------
#   Define symbol for files included in our link and resource merge
#----------------------------------------------------------------------

Objs =  $(objectDir)AssetID.mo \
                $(mdlLibs)rdbmslib.dlo \
                $(mdlLibs)ditemlib.dlo \
                $(mdlLibs)mdllib.dlo
       
Rscs = \
    $(objectDir)assetidcmd.rsc \
    $(objectDir)assetid.rsc \
    $(objectDir)assetid.mp

#---------------------------------------------
#       Generate Command Tables
#---------------------------------------------
$(incDir)assetidcmd.h    : $(baseDir)assid_cmd.r

#---------------------------------------------
#       Compile Dialog Resources
#---------------------------------------------
$(objectDir)assetid.rsc: $(baseDir)assetid.r $(incDir)assid_ids.h
#---------------------------------------------
#       Compile Command Resources
#---------------------------------------------
$(objectDir)assetidcmd.rsc: $(baseDir)assid_cmd.r

#---------------------------------------------
#       Compile and link MDL Application
#---------------------------------------------
$(objectDir)assetid.mo:   $(baseDir)assetid.mc $(incDir)assetidcmd.h



$(objectDir)assetid.mp:   $(Objs)
        $(msg)
        >$(objectDir)make.opt
        $(linkOpts)
        -a$@
        $(Objs)
        <
        $(MLinkCmd) @$(objectDir)make.opt
        ~time


#---------------------------------------------
#       Merge Objects into one file
#---------------------------------------------
$(mdlapps)assetid.ma:  $(Rscs)
        $(msg) 
        >$(objectDir)make.opt
        -o$@
        $(Rscs)
        <
        $(RLibCmd) @$(objectDir)make.opt
        ~time

and the setting in the mstndevvars.bat is as follows,

@echo off

echo Visual C++ product directory could not be found.
echo Set nttools to Visual C++ product directory.
echo Set LIB and INCLUDE appropriately.
set nttools=
set LIB=
set INCLUDE=

set MS=C:\Bentley\Program\MicroStation
set BMAKE_OPT=-I%MS%\mdl\include -I%MS%\jmdl\include
set PATH=;%MS%;%MS%\mdl\bin;%MS%\jmdl\bin;%PATH%
set CLASSPATH=.;%MS%\jmdl\lib\rt.jar;%MS%\jmdl\lib\jmdlsdk.jar;%MS%\jmdl\lib\swingall.jar;%MS%\jmdl\lib\bentley.jar;%MS%\jmdl;%CLASSPATH%
set MLINK_STDLIB=%MS%\mdl\library\builtin.dlo %MS%\mdl\library\dgnfileio.dlo %MS%\mdl\library\toolsubs.dlo

C:
cd \Bentley\Program\MicroStation

 

And my Environment Variables:

BMAKE_OPT

-IC:\Bentley\Program\MicroStation\MDL\include -IC:\Bentley\Program\MicroStation\MDL\include\stdlib

MDL_COMP

C:\Bentley\Program\MicroStation\mdl\include

MLINK_STDLIB

C:\Bentley\Program\MicroStation\mdl\library\builtin.dlo;C:\Bentley\Program\MicroStation\mdl\library\dgnfileio.dlo;C:\Bentley\Program\MicroStation\mdl\library\toolsubs.dlo

MS

C:\Bentley\Program\Microstation

 

MSMDE

C:\Bentley\Program\Microstation\

 

  • By the way, I am using Windows Vista Business as the platform. I couldn't install the Microstation V8 2004 under the directory of C:\Program Files since it always shows error in finding the location of rcomp command. I found it doesn't allow space in the directory.

    I tried to compile the same mdl project under the V8i version, still got the same error message:

    C:\Bentley\Program\MicroStation\mdl\include.mc: can't open

  • Hi deeko,

    did you start the compilation from MicroStation Developer Shell or from a plain DOC command prompt?

    The compilation is not only about the variables you mentioned, it is pretty complex process, and the Developer Shell will set everything (nearly :-) for you automatically.

     Jan

  • Thank you for you quick reply. I did start the compilation from the Microstation Development Shell. To me, it seems it did nothing except running the mstndevvars.bat (it was automatically generated when I installed the Microstation). 

  • Yes, you are right, Developer Shell is not a magic, but set everything as required, so it is good base point where you can start. It is not generated when MicroStation is installed, but when MicroStation SDK is installed (to be precise, but  ;-)

    To be sure everything is fine you can try to compile some from the SDK examples, that were installed into your Documents directory. Start the Deveveloper Shell with administrators right, go to e.g. ..\basic SDK directory and type bmake basic (or bmake -dDLM_NO_SIGN basic if signature error appears).

    The basic example should be compiled without an error message and it will help to decide if the compilation process is running fine. In such case your problem is probably in the application bmake file.

    HTH Jan

  • I tried the basic project, same error happend. Is it because I am using Windows Vista? My colleague is using Windows XP and he has no such problem.

     

    Visual C++ product directory could not be found.
    Set nttools to Visual C++ product directory.
    Set LIB and INCLUDE appropriately.

    C:\Bentley\Program\MicroStation>cd mdl\examples\basic

    C:\Bentley\Program\MicroStation\mdl\examples\basic>bmake basic
    Bentley Systems Make Utility. Version 08.11.00.06, Sep  5 2007
    Mon Apr 11 16:01:19 2011

    ~mkdir C:\Bentley\Program\MicroStation\mdl\objects

    ~mkdir C:\Bentley\Program\MicroStation\mdl\rscobj

    ~mkdir C:\Bentley\Program\MicroStation\mdl\reqdobjs

    [== Building C:\Bentley\Program\MicroStation\mdl\objects\basiccmd.h, (C:\Bentley\Program\MicroStation\mdl\examples\basic
    \basiccmd.r) ==]
    C:\Bentley\Program\Microstation\mdl\bin\rcomp @C:\Bentley\Program\MicroStation\mdl\objects\make.opt
    MicroStation Resource Compiler 08.05.02
       Generating header file (C:\Bentley\Program\MicroStation\mdl\objects\basiccmd.h) ... done.

    [== Building C:\Bentley\Program\MicroStation\mdl\objects\basictyp.r, (C:\Bentley\Program\MicroStation\mdl\examples\basic
    \basictyp.mt) ==]
    C:\Bentley\Program\Microstation\mdl\bin\rsctype @C:\Bentley\Program\MicroStation\mdl\objects\make.opt
    MicroStation Type Resource File Generator 08.05.02
    C:\Bentley\Program\MicroStation\mdl\include.mt: can't open
    No such file or directory
    BMAKE: call trace
        line:   64, C:\Bentley\Program\MicroStation\mdl\examples\basic\basic.mke
    Mon Apr 11 16:01:19 2011, elapsed time: 0:00

    C:\Bentley\Program\MicroStation\mdl\examples\basic>

  • for me it looks like the include.mc, and include.mt are indeed inside the sourcecode. I've seen some developers who use such a approach to include common (company standard) things.

    So look inside your own assetid.mc for a line (the C source file)

    #include include.mc

    and in your basictyp.r (the ressourcefile)

    #include include.mt

    this is a type definition file and used for propagating sturcture types outside your app.

    the reason why the error is reported in a specific line of the .mke files, is that this line invokes the compiler call. But both are compiler errors

    HTH Michael



  • Thanks for help. I have fixed the problem. What I did is to remove all the environment variables that I generated according to the following webpage:

    www.la-solutions.co.uk/.../MdlDevelopmentEnvironment.htm

    And now everything works fine. Very strange though.

  • Hi deeko,

    if you use MicroStation Developer Shell, everything is set up automatically, so you don't need to change anything (at least it is the intention of the shell :-).

    What Jon describes at the page you mention is in fact explanation of MSDEVVARS, which is called by Developer Shell, and other valuable information helpful if you need to change the standard setting manually.

    With regards,

     Jan

  • deeko said:
    What I did is to remove all the environment variables that I generated according to the following webpage

    Thanks for that feedback. As Jan comments, the description of the Windows environment variables is intended to help you understand the settings defined by mstndevvars.bat. It's not intended to be a prescription for you to define your own environment.

    I've edited that section about MDL environment variables. It should now be clearer that the Bentley command shell defined by mstndevvars.bat is the one to use.

    As an experienced MicroStation developer, you may eventually find it useful to be able to define a permanent environment for MicroStation development. I use that web page myself as an aide-mémoire because there is so much to remember (or, in my case, so much I have already forgotten).

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions