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?
amender carapace said:how do you set the Windows Kit path ?
There is no reason to set anything like that.
When your Visual Studio is installed correctly, everything is set, and recognized automatically by bmake / mkl files.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
how do you set the Windows Kit path ?
Ken Adams said:Can anybody help me get this setup correctly?
Here are some instructions on how to install Viz Studio 2015 for C++ development.
Regards, Jon Summers LA Solutions
Hi Ken Adams,
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 docs.bentley.com, 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.
HTH,Bob
Hi Ken,
Ken Adams said: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.
Ken Adams said: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.
Ken Adams said: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:
I guess Robert Hook should be able to provide better insight where the problem can be.
With regards,
I broke down and uninstalled the SDK and resinstalled it in the default location. The definiely helped. I am getting a lot further now.
It still complains about not being able to find mt.exe.
[== Building "C:\PROGRA~1\Bentley\MICROS~1\MICROS~1\mdlapps\ElementsExample.dll" , (C:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\ElementsE xample.obj) ==] link -out:"C:\PROGRA~1\Bentley\MICROS~1\MICROS~1\mdlapps\ElementsExample.dll" - WX -Ignore:4087 -Ignore:4089 -Ignore:4199 -MANIFESTUAC:NO -Release -debug - incremental:no -fixed:no @C:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStati onSDK\objects\ElementsExamplelink.rsp Microsoft (R) Incremental Linker Version 14.00.23026.0 Copyright (C) Microsoft Corporation. All rights reserved. -dynamicbase -dll "-out:C:\PROGRA~1\Bentley\MICROS~1\MICROS~1\mdlapps\ElementsExample.dll" "-implib:C:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\Ele mentsExample.lib" "-pdb:C:\PROGRA~1\Bentley\MICROS~1\MICROS~1\mdlapps\ElementsExample.pdb" -debug -incremental:no -fixed:no -MANIFEST -MANIFESTFILE:C:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\object s\ElementsExample.dll.Manifest C:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\ElementsExam ple.obj C:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\Elem entsExampleCreateTool.obj C:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStati onSDK\objects\ElementsExampleCopyTool.obj C:\Users\KWA0GSU\AppData\Local\Temp\Be ntley\MicroStationSDK\objects\ElementsExampleEditTool.obj C:\Users\KWA0GSU\AppDa ta\Local\Temp\Bentley\MicroStationSDK\objects\ElementsExampleQueryTool.obj C:\PR OGRA~1\Bentley\MICROS~2\library\bentley.lib C:\PROGRA~1\Bentley\MICROS~2\library \BentleyAllocator.lib C:\PROGRA~1\Bentley\MICROS~2\library\mdlbltin.lib C:\PROGR A~1\Bentley\MICROS~2\library\RmgrTools.lib C:\PROGRA~1\Bentley\MICROS~2\library\ BentleyGeom.lib C:\PROGRA~1\Bentley\MICROS~2\library\DgnPlatform.lib C:\PROGRA~1 \Bentley\MICROS~2\library\dgnview.lib gdi32.lib user32.lib kernel32.lib C:\PROGR A~2\MICROS~3.0\VC\\lib\amd64\msvcrt.lib C:\PROGRA~1\Bentley\MICROS~2\library\mdlbltin.lib Creating library C:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\ objects\ElementsExample.lib and object C:\Users\KWA0GSU\AppData\Local\Temp\Bentl ey\MicroStationSDK\objects\ElementsExample.exp mt.exe -manifest C:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\obj ects\ElementsExample.dll.Manifest -outputresource:"C:\PROGRA~1\Bentley\MICROS~1\ MICROS~1\mdlapps\ElementsExample.dll";2 'mt.exe' is not recognized as an internal or external command, operable program or batch file. BMAKE: call trace line: 411, C:\PROGRA~1\Bentley\MICROS~2\mki\dlmlink.mki line: 114, C:\mdl2\examples\Elements\ElementsExample\elementsexample.mke Wed Mar 06 16:59:56 2019, elapsed time: 0:16 C:\mdl2\examples\Elements\ElementsExample>
I tried hard coding the path in parentheses: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x64/mt.exe". The spaces are still fooling it.
C:\PROGRA~1\Bentley\MICROS~2\library\mdlbltin.lib Creating library C:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\ objects\ElementsExample.lib and object C:\Users\KWA0GSU\AppData\Local\Temp\Bentl ey\MicroStationSDK\objects\ElementsExample.exp "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64\mt.exe" -manifest C :\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\ElementsExamp le.dll.Manifest -outputresource:"C:\PROGRA~1\Bentley\MICROS~1\MICROS~1\mdlapps\E lementsExample.dll";2 'C:\Program' is not recognized as an internal or external command, operable program or batch file. BMAKE: call trace line: 411, C:\PROGRA~1\Bentley\MICROS~2\mki\dlmlink.mki line: 114, C:\mdl2\examples\Elements\ElementsExample\elementsexample.mke Wed Mar 06 17:09:11 2019, elapsed time: 0:16 C:\mdl2\examples\Elements\ElementsExample>
I finally got it to work by copying mt.exe to the ElementsExample folder. Is it normal to have to do that?
But be aware it's just a guess!
My problem is that I have installed SDK in default location, so I cannot check whether there is an issue somewhere else and corrupt the compilation only when location is not standard.
On the other hand, if specifying full path to included mki files work for you, it's acceptable workaround.
Ken Adams said:A full instal of VS 2015 got me past the stdint.h missing error and scanfile is now compiling without error.
Great, this is step forward :-)
Ken Adams said:The SDK still doesn't seem to know where the .mki files are.
What looks to me weird is
Macro: BMAKE_ARGS=-IC:\mdl2\mki\; -a -v -dCCompOpts=-E
particularly a semicolon in a middle.
You have to find where it comes from, it looks like you edited some file and entered the semicolon by accident. What will happen when you start compilation without any parameters.
When no parameters compilation also not work, I recommend to start with MicroStationDeveloperShell.bat and check how from 2nd shell argument (MSMDE) is built BMAKE_OPT variable. From some reason, somewhere in a middle of the process, extra sign seems to be added.
A full instal of VS 2015 got me past the stdint.h missing error and scanfile is now compiling without error.
The SDK still doesn't seem to know where the .mki files are. I notice the scanfile .mke file specifies it this way:
%include $(MDLMKI)mdl.mki. This is working for me.
But the elementsexample specifies it like this: %include mdl.mki. This is producing this error:
C:\mdl2\examples\Elements\ElementsExample>bmake -a -v -dCCompOpts=-E elementsexa mple.mke Macro: CCompOpts=-E Macro: BMAKE_ARGS=-IC:\mdl2\mki\; -a -v -dCCompOpts=-E Macro: BMAKE_BUILD_ALL_LOCAL=(none) Macro: BMAKE_BUILD_ALL=(none) Macro: elementsexample.mke__ccompopts__e_=(none) Bentley Systems Make Utility. Version 10.00.00.26, Mar 15 2018 Tue Mar 05 09:19:01 2019 Macro (elementsexample.mke:0): %=$% Macro (elementsexample.mke:0): $%=$% Macro (elementsexample.mke:0): %=$% Macro (elementsexample.mke:0): $%=$% Macro (elementsexample.mke:0): winNT=(none) Macro (elementsexample.mke:0): MSBuildVersion=400 Macro (elementsexample.mke:0): TaskMultiTargetingToolsVersion=4.0 Macro (elementsexample.mke:0): _X86_=(none) Macro (elementsexample.mke:0): _MakeFileSpec=C:\mdl2\examples\Elements\ElementsE xample\elementsexample.mke Macro (elementsexample.mke:0): _MakeFilePath=C:\mdl2\examples\Elements\ElementsE xample\ Macro (elementsexample.mke:0): _MakeFileName=elementsexample Macro (elementsexample.mke:0): _MakeFileExt=.mke Macro (elementsexample.mke:0): _MakeFile=elementsexample.mke Macro (elementsexample.mke:0): _bmake=bmake Macro (elementsexample.mke:0): _bmake_V10=1 Macro (elementsexample.mke:0): _bmake_LegalCopyright=Copyright (c) 2019 Bentley Systems, Incorporated. All rights reserved. Macro (elementsexample.mke:8): PolicyFile=MicroStationPolicy.mki Macro (elementsexample.mke:9): appName=ElementsExample Macro (elementsexample.mke:10): sAppName=ElementsExample Macro (elementsexample.mke:12): baseDir=$(_MakeFilePath) Macro (elementsexample.mke:13): privateInc=$(baseDir) Macro (elementsexample.mke:14): langSpec=$(baseDir)english\ Macro (elementsexample.mke:15): mdlLibs=$(MSMDE)library\ C:\mdl2\examples\Elements\ElementsExample\elementsexample.mke(17) : error : can' t open include file mdl.mki BMAKE: call trace line: 17, C:\mdl2\examples\Elements\ElementsExample\elementsexample.mke Tue Mar 05 09:19:01 2019, elapsed time: 0:00 C:\mdl2\examples\Elements\ElementsExample>
Ken Adams said:Stdint.h is in C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include
In my opinion it's the proof your installation is wrong / incorrect. And it also demonstrates that there are more Visual Studio versions installed on your computer, which is not problem, but environment configuration has to be correct.
Are you aware of Visual Studio versions numbering? Visual Studio 11.0 is 2012, so when there is no stdint.h available in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ (because 14.0 is 2015), it probably means you have not installed all required Visual Studio 2015 C++ modules.
I mentioned VS parts (CommonTools, SDK...) I guess have to be installed to compile C++ code. Did you check it?
There are really many discussions avaiable on Internet, many of them on StackOverflow, what parts of VisualStudio have to be installed and what to do when the discussed problem (not found header file) is reported.