How to compile example mdl programs

I have installed the latest Microstation Connect and SDK and am trying to compile some of the examples. Can anybody help me get this setup correctly?

Parents Reply
  • Hi Ken,

    I broke down and uninstalled the SDK and resinstalled it in the default location.

    from your anwer it seems you did not do it fully, because your example still resides in c:\mdl2\ and not in C:\Program Files\Bentley\MicroStationCONNECTSDK\examples\.

    Despite of I do not think it can cause any problem, it's not clear what your current configuration is.

    It still complains about not being able to find mt.exe.

    mt.exe tool is a part of Windows SDK, not MicroStation SDK or Microsoft C++ compiler.

    On my computer I can find several these files, but from MicroStation SDK shell version C:\Program Files (x86)\Windows Kits\10\bin\x86\mt.exe seems to be called, but it exists also in \x64 etc.). You can use "where mt.exe" command to check where a particular program is found.

    I finally got it to work by copying mt.exe to the ElementsExample folder. Is it normal to have to do that?

    Absolutely not. MicroStation SDK CONNECT Edition should be able to adapt to local Windows configuration without any manual modification. When any such manual change is necessary,  something is wrong.

    mt.exe is identified and path to it is set (added to PATH variable) during MicroStation SDK startup process, so it should be accessible without full path specification.

    You can try:

    • When command prompt (cmd) is started normally, mt.exe is not found, because Windows Kit path is not set.
    • When you open Developer Command Prompt for VS2015, which is a part of Visual Studio installation, you should be able to use mt.exe.
    • The same is for MicroStation SDK, where you can compare PATH variable how it is set in normal Windows command prompt (DOS shell) and how it's displayed when MicroStation SDK is started.

    I guess should be able to provide better insight where the problem can be.

    With regards,


  • Hi ,

    I am sorry to see you having such a difficult time getting up and running with the MicroStation Developer Shell Requirements.  I also wish I could directly point you to the SDK Readme Requirements typically located directly on, Through necessity I do know I updated the SDK requirements for Update 12 (due to be released any day) to ensure plenty of Microsoft Visual Studio requirements and installation resource references are available in the typical (local) MicroStation CONNECT SDK Readme. For MSCE SDK U12 and later I will certainly update the SDK Annoucements to reflect current SDK Requirements in full detail.

    So, as you have found you will need to install/configure the "Microsoft Windows 10 SDK" option (even if you don't have Windows 10 yet) due to our product level make file assertion/requirements.  I am looking into seeing if we can make that conditional (internal vs. external/public) since that component to the best of my knowledge if only for applications requiring Debug Diagnostics implementations (we do, but most app developers don't).

    If the Windows SDK is installed and the developer shell can correctly locate your Microsoft Visual Studio "vcvars32.bat" file properly - you can check by typing:

    set _SDKVSENV

    Then the developer shell should be able to locate "mt.exe" using the Microsoft Windows "where.exe" to find the appropriate location, like:

    C:\PROGRA~1\Bentley\MICROS~2>where mt
    C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\mt.exe
    C:\Program Files (x86)\Windows Kits\10\bin\x86\mt.exe

    The developer shell tries to correctly locate and initialize Microsoft's development environment (MSCE SDK U11/VS2015 and prior call vcvars32.bat, MSCE SDK U12/VS2017 and later call VsDevCmd.bat) to do all the proper and heavy lifting to configure it's toolsets properly and we rely on it for our build tools to work properly.

    I believe in MSCE SDK U10 I provided a "build.bat" (has a -verbose option) that can make troubleshooting between developers easier so we can say "send me your 'build' output" and a user can type "build" or "build verbose" to get detailed build output and optional (verbose) full OS environment variables included.

    So, if you are still having issues please try to "build verbose" your example and post your "Build-[YourAppNameHere]-Verbose-Output.txt", and I am sure we can straighten out any outstanding issue preventing you from compiling the SDK examples.