I have just started to recompile our V8 mdl programs to V8i, but I got stuck with the compilation. The first problem I ran into was that I got this message:
[== Generating compiler environment file c:\kallkod\mdl\mdlapps\compenv.mki, (C:\BentleyV8i\MicroStation\mdl\include\compenv.c) ==] cl -nologo C:\BentleyV8i\MicroStation\mdl\include\compenv.c -EP > c:\kallkod\mdl\mdlapps\compenv.mki 'cl' is not recognized as an internal or external command, operable program or batch file. Wed May 27 10:26:53 2009, elapsed time: 0:00 BMAKE: file [c:\kallkod\mdl\mdlapps\compenv.mki] may be incomplete BMAKE: call trace line: 57, C:\BentleyV8i\MicroStation\mdl\include\compilers.mki line: 34, C:\BentleyV8i\MicroStation\mdl\include\mdl.mki line: 12, C:\Kallkod\mdl\Bolis8i\meny\Bolmeny.mk8i
I found a thread about it where the suggestion was to add -dBUILD_USING_VS2005 to the command line. I tried that (I'm not sure I put it in the right place though...), but it didn't help.
I'm probably not doing it the "normal" way... I'm using our own batch-file (used from V7) from which I compile to all the version we use. The part concerning V8i looks like this:
set MS=C:\BentleyV8i\MicroStation set mdltools=%MS%\ set MSMDE=%mdltools% set BMAKE_OPT=-I%mdltools%mdl\include set BOLIS_SRC=c:\KALLKOD\mdl\bolis8i set BOLIS_LIB=c:\kallkod\mdl\bolislib set BOLIS_APPL=c:\kallkod\mdl\mdlapps set gensrc=%BOLIS_APPL%\ set PATH=%MS%;%mdltools%mdl\bin\;%BOLIS_SRC%\bin;%PATH% set MLINK_STDLIB=%mdltools%mdl\library\builtin.dlo %mdltools%mdl\library\BentleyDgn.dlo %mdltools%mdl\library\toolsubs.dlo
for %%f in ( *.mk8i ) do %MS%\mdl\bin\bmake.exe -dBUILD_USING_VS2005 %%f
All our make-files are written so that the file directory in which we have the source code is has to be the active directory. This batch file simply finds all the make-files in that directory and compiles them.
/Lena
Lena: The first problem I ran into was that I got this message: 'cl' is not recognized
With MicroStation XM and later the Bentley build tools assume that we're attempting to compile a native C/C++ project. c1.exe is Microsoft's C++ compiler executable.
We're encouraged to write C++ code these days, calling the MicroStation Development Library (MDL) as required. If you're compiling pure MDL code (i.e. not C/C++ native code) then you need to turn off the relevant switches. Unfortunately, the relevant switches are not always easy to find, because some are buried in bmake include (.mki) files that are hard to understand.
A good way to start is to follow Phil's recommendation: start the Bentley command shell, and build a single project manually. Once you have that working, you can transfer the Windows environment variable definitions to your own batch builder.
Regards, Jon Summers LA Solutions
I don't have any means to write C++ code (not allowed to buy any programming tools really...) so I'm using pure MDL code. I haven't been able to figure out where to start this command shell you're writing about. The only mention of it I find in the SDK ReadMe is about mstndevvars.bat, which I have looked at already (some lines in my batch file where copied from there), and briefly in the MDL Programmer Guide just recommending us to use it.
How do I start it? Can I find any description on how to use it?
Lena
/Lena A
Lena: I'm using pure MDL code. I haven't been able to figure out where to start this command shell you're writing about. How do I start it? Can I find any description on how to use it?
If the MicroStation\mdl\bin folder is not in your Windows PATH, then you will need to enter the full path to mstndevvars.bat.
Lena: I don't have any means to write C++ code (not allowed to buy any programming tools really...).
You can continue to use MDL as you have been doing for many years. However, from V8i some new functions are implemented in the MicroStationAPI, which is C++ only.
Lena: Not allowed to buy any programming tools really...
You should inform your employer that your ability to perform your job will be impaired.
Thanks, but I'm afraid it didn't help much... I had already copied some lines from mstndevvars.bat: setting MS, mdltools, MSMDE, BMAKE_OPT, path, MLINK_STDLIB - just leaving the part about the build policy machinery because it didn't work, and the creation of the directories I'm not going to use.
I got the error "Attempting to build with VS 2005 but location is undefined!". Any options to bmake that I'm missing?
Not to plug the BDN group too much but you might want to look at the latest Blog posting describing how to use VisualStudio Express C++ to compile native code MDL applications. Yes it still uses the command shell (shows my age) but the compiler is free so it might be worth a look. And if you have questions or comments we are all here to help.
Rgds,
Mark Anderson [Bentley]
mark anderson [Bentley]
Visit me at https://communities.bentley.com/communities/other_communities/bentley_innovation/default.aspx
Add this to the command line -dNO_COMPILERS_MKI and -dBUILD_USING_NoToolset to prevent us trying to check for the native tools. I would also suggest not just pulling out the elements of the batch file just use the developer shell as is if at all possible.
HTH,
I'm also faced the same problem while compiling v8 mdl code in v8i compiler.
But i just replace the include and library folders from V8 XM to V8i. Now the problem has been solved.
I'm not sure this is a right way to do that.
Regards,
Jeyan.
Jeyan: I also faced the same problem while compiling v8 MDL code in v8i compiler. But I just replace the include and library folders from V8 XM to V8i.
I also faced the same problem while compiling v8 MDL code in v8i compiler.
But I just replace the include and library folders from V8 XM to V8i.
Paths to folders should be defined relative to the MS or MSMDE environment variables. The dev. shell is specific to each installation of MicroStation, so it will always find the right folders.