Good Morning, I have a problem porting my apps from mdl to native code.
I've modified my code as it written in the link below reported
http://communities.bentley.com/products/microstation/microstation_v8i/microstation_v8i_programming/w/microstation_v8i_programming_wiki/mdl-_2d00_-native-code-application-development.aspx
But when i compile with microstation shell the next error appear:
[== Building C:\Programmi\Bentley\Program\MicroStation\mdl\objects\UserCase.obj, (D:\Codice\ESEMPI~3\UserCase2\mdl\UserCase.cpp) ==]cl -GX -Dtarget_is_dlm -IC:\Programmi\Bentley\Program\MicroStation\mdl\include -I -IC:\Programmi\Bentley\Program\MicroStation\mdl\include\geom -IC:\Programmi\Bentley\Program\MicroStation\mdl\objects -G5dF -D_X86_=1 -Di386=1 -c -W3 -DWIN32 -DwinNT -MD -D_VISCXX -DWIN32_LEAN_AND_MEAN -Od -nologo -WX -Zi -Od -GZ -Oy- -FoC:\Programmi\Bentley\Program\MicroStation\mdl\objects\UserCase.obj D:\Codice\ESEMPI~3\UserCase2\mdl\UserCase.cppUserCase.cppC:\Programmi\Bentley\Program\MicroStation\mdl\include\toolsubs.h(45) : fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
I tryed to compile an example but I have the same result.
What can i do?
Alder
stdio.h is in the \MicroStation\mdl\include\stdlib folder. If you use the Bentley development shell to set the environment before building your application, that folder should be included in the search paths automatically.
You can check by using the Bentley development shell to open a command window, then use the Windows SET command to display the environment settings. You should see something like this …
BMAKE_OPT=-IG:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\include\ -IG:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\include\stdlib\ -IG:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\MicroStationAPI\
[Note: the third -I is not used in V8.5 2004 Edition - it refers to the MicroStationAPI, which is delivered with XM and later]
Regards, Jon Summers LA Solutions
My variable is set to
BMAKE_OPT=-IC:\Programmi\Bentley\Program\Microstation\mdl\include -IC:\Programmi\Bentley\Program\Microstation\jmdl\include
How can I change it?
You may find this article about Environment Variable BMAKE_OPT interesting.
When you invoke mstndevvars.bat it should set up the environment shell correctly.
I'm a little bit confused about the versions.
We're in the 2004edition forum so 8.5. This needs VS6 (afaik there's no change to that)
Alder is mentioning a change from V8i (8.11). This need VS 2005 and above (as long as you don't need MFC than 2005 is fixed)
VS 2003 is only relevant for Ustn XM (8.9) so you should clearify, what we're talking about
Michael
I've modified my mstndevvars.bat as it written in the guide but it doesn't work...
The message in the shell is still the same.
Here is my mstndevvars.bat:
@echo offecho 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:\Programmi\Bentley\Program\MicroStationset MSDE=C:\Programmi\Bentley\Program\MicroStationset BMAKE_OPT=-I%MS%\mdl\include -I%MS%\mdl\include\stdlib -I%MS%\jmdl\includeset 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.dloD:cd D:\Codice\Gestuti_Ora\AppsComuni\
What can I do?
Michael, I'm developing in the 2004 edition and I have installed visual studio 6.0 and visual studio .net 2003.
set MSDE=C:\Programmi\Bentley\Program\MicroStation
That should be MSMDE not MSDE.
Jon, I corrected the variable MSMDE but another error appear:
BMAKE: file [C:\Programmi\Bentley\Program\MicroStation\mdl\objects\CMD_Batch.rsc] may be incomplete
BMAKE: call trace
line: 23, D:\Codice\Gestuti_Ora\AppsComuni\CMD_Batch\DLLCMD_Batch.mke
It doesn't work also with the mke not modified (V8CMD_Batch.mke)!
If I cancel the variable MSMDE it work...
If you have V8i, take a look at the MDL examples delivered with the V8i SDK. They have all been rewritten to compile to native code using the Bentley shell and the Microsoft C/C++ compiler.
If you don't have V8i, then take a look at these examples. They won't compile with V8.5 because you don't have the MicroStationAPI. However, they do provide examples of working bmake files that create a native-code DLL.