MicroStation Developer Shell Problem

I now have VS 2005 Professional.  I am trying to use bmake to compile a pre-made C++ app.  I open the "MicroStation Developer Shell" and then type "bmake" and the name of the .mki file.  In this case the folder is basic and the file is basic.mke.  In the MicroStation Developer Shell I type

bmake C:\Users\Chad\Desktop\basic\basic

The location of bmake is C:\Program Files (x86)\Bentley\MicroStation\mdl\bin>

The error it shows is 

C:\Users\Chad\Desktop\basic\basic.mke(20) : error : can't open include file mdl.mki

Note: I do have the file mdl.mki under C:\Program Files (x86)\Bentley\MicroStation\mdl\include.

But the main problem I think this all stems from happens when I open up the MicroStation Developer Shell.  Upon opening it reads:

#-----------------------------------------------------------------------
# ERROR: Bad parameter
# Usage = MSTNDEVVARS.BAT "C:\Program Files (x86)\Bentley\MicroStation" "C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)"
# e.g. C:\Windows\system32\cmd.exe /x /k "C:\Program Files\Bentley\MicroStation\mdl\bin\mstndevvars.bat C:\Program Files\Bentley\MicroStation\ C:\Program Files\Bentley\MicroStationSDK\"
#-----------------------------------------------------------------------

I opened up mstndevvars.bat.  It looks like it is going to the usage_error from:

IF "%MS%." == "." goto USAGE_Error

And then it goes to Usage_error and the program ends after that.

:USAGE_Error
@ECHO #-----------------------------------------------------------------------
@ECHO # ERROR: Bad parameter
@ECHO # Usage = MSTNDEVVARS.BAT "C:\Program Files (x86)\Bentley\MicroStation" "C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)"
@ECHO # e.g. %comspec% /x /k "C:\Program Files\Bentley\MicroStation\mdl\bin\mstndevvars.bat C:\Program Files\Bentley\MicroStation\ C:\Program Files\Bentley\MicroStationSDK\"
@ECHO #-----------------------------------------------------------------------
GOTO end

I wasn't sure what I needed to do so that  "%MS%." == "." is false so I don't get the usage error.  Thank you for your help.

Parents
  • Hi,

    as Michael noted, MicroStation Developer Shell should be opened using a shortcut created during SDK installation. Mstndevvars.bat should not be started directly.

    If you start the shell using the shortcut and an error message still exists, the shell parameters are not set or are set incorrectly. You should check the shortcut parameters, if it's set to a proper folders.

    Personally I changed the shortcut a bit in this way:

    • In Windows I created a new variable on a system level MSV8i=C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)\MicroStation\
    • I created a new shortcut to mstndevvars.bat and set the target as C:\Windows\SysWOW64\cmd.exe /x /k ""C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)\MicroStation\mdl\bin\mstndevvars.bat" "%MSV8i%" "%MSV8i%""

    Another note: After you start the shell, in my opinion it's better to go to a folder where example resides, so you can start the compilation using e.g. bmake basic.mke without the need to enter the full path.

    It's also recommended to start the shell As Administrator to be sure the make process will receive enough right to write into MicroStation program folders.

    With regards,

      Jan

    Answer Verified By: HDR_Coder 

  • Thank you for all the help,

    I
    set MSV8i=C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)\MicroStation\
    in Mstndevvars.bat. After this I replaced
    IF "%MS%." == "." goto USAGE_Error with IF "%MSV8i%." == "." goto USAGE_Error

    This seemed to fix the problem so that everything sets up in the developer shell.

    I now ran the MicroStation developer shell as administrator, cd to the folder, and ran the bmake appname and got it to start compiling.

    In my case I went to the toolExample folder and ran bmake toolExample. It created an mdlapps folder and a dll and a PDB file. But I wasn't sure if it finished, as I got a BMAKE: call trace error in the developer shell that said,
    "
    All rights reserved.
    singleton "C:\PROGRA~2\MI30EB~1\SDK\v2.0\\Bin\signtool.exe" sign /f developer.pf
    x /p bsidev "mdlapps\toolExample.dll"
    'singleton' is not recognized as an internal or external command,
    operable program or batch file.
    BMAKE: call trace
    line: 442, C:\PROGRA~2\Bentley\MICROS~2\mdl\include\dlmlink.mki
    line: 95, C:\Users\Chad\Documents\MDLProjects V8i (SELECTseries 1)\toolexa
    mple\toolexample.mke
    Mon Jun 08 07:21:31 2015, elapsed time: 0:05
    "

    It seems like it might have finished and only errored out at the end, I was not sure.

    I cannot find a .ma file, although under MicroStation\mdl\objects it created a

    toolExample.exp, .rsc, .obj, .manifest, .map, and .rsp.

  • Hi,

    Unknown said:
    as I got a BMAKE: call trace error in the developer shell that said...

    It was discussed in the past several times already, compile (any) example using bmake -dDLM_NO_SIGN <make file>, e.g. bmake -dDLM_NO_SIGN toolexample.mke. DLM_NO_SIGN macro prevents the application be signed using digital certificate, which obviously will fail if not configured properly.

    Regards,

      Jan

  • Thank you! I was able to create the .ma file. I am off to tinkering these files and starting to make my own!
  • Hi,

    one more note: In make files there is a place where more macros like DLM_NO_DLS etc. are defined. You can add DLM_NO_SIGN = 1 definition there to don't have to include it into the commmand line.

    Regards,

    Jan
  • I had one other issue that came up. I tried to compile tagexmpl. I keep getting the error
    LINK: fatal error LNK1104: cannot open file 'mdlapps\tagexmpl.dll'

    earlier in toolexample the bmake command created the mdlapps folder and the toolexample.dll. This time it is not being created. Thank you for your help again.
Reply Children
No Data