Error on compile .mc file?

Dear all,

            i am trying to create simple mdl application using text editor. I am write the code and compile the code using "Microstation development shell" but i get the following error.

"Error:"

Microstation Development Language Compiler 08.05.02
Files.mc: Can't open
No such file or directory

Sample Code:

#include <mdl.h>
#include <dlogitem.h>

int main()
{
mdlDialog_openInfoBox(“Hello World!!”);
return 0;
}


Here i attached my process screen shot:
1.Create MC File

 

2.Enter the Header file Path.


 

3.Compile my Code:


4.Error Message.

thanks.

  • Hi Karthik,

    the error message is clear: mcomp.exe was not able to find Hello.mc file. So you have to ensure such file in the specified location really exists. Better approach is probably to start mcomp.exe directly from the folder where the file is located, so no full path to the file is required.

    Also I am not sure how (and if) mcomp.exe handles text file coding. What is Hello.mc? Is it plain ASCII (using local code page) or is it some type of Unicode (with or without BOM)? You should ensure all files are ASCII.

    I suppose there will be other error messages after the file will be compiled (e.g. to set path to header correctly), but the problems should be solved step by step.

    Another question is why to play with MDL compilers that were marked as obsolete in MicroStation 8.0 (more than 15 years ago) and is not available anymore in current MicroStation version. I vaguely remember to use native C code has been recommended from V8.0.

    With regards,

    Jan
  • hi jan,
    Thanks for your reply. i have some mdl codes collect from Microstation v8 MDL function Reference.chm but i don't know where i am type the code and how to compile the code so i request to you give me the step by step process that is very helpful for me.

    thanks.
  • Hi Karthik,

    Unknown said:
    so i request to you give me the step by step process that is very helpful for me

    Frankly, you probably don't know what are you talking about. In my opinion to write down step by step process how to create and build MDL application, especially if it's not clear what your current knowledge is, so it should be basic and general, is several hours (and maybe be even a couple of days) work ... especially for non native English speaker as I am.

    Unknown said:
    have some mdl codes collect from Microstation v8 MDL function Reference.chm

    Why did you collect the code? MicroStation SDK is delivered with set of standard examples that can be used to start the learning. Moreover you can be sure they are tested and it's possible to compile them using bmake.

    Unknown said:
    but i don't know where i am type the code and how to compile the code

    Did you try to read MicroStation Programmer Guide? There are plenty of very useful information there.

    Basic question is what is you current knowledge. Do you know C and how C code is compiled and linked? If not, I see no reason why to start to learn MDL, because such knowledge is crucial and mandatory. If you are not able to compile and link code manually using e.g. gcc compiler, plenty of topics in MDL will be not clear for you. MDL is Bentley properietary implementation of C language, but the main concepts (compilation to object files, lining obj with libraries etc.) are the same.

    With regards,

      Jan

  • In addition to Jan's recommendations...

    1. Use the developer command shell ustndevvars.bat (or something like that), which sets up the environment for you.  It's located in a folder \mdl\bin
    2. Windows Notepad is not a good choice as a programmer's editor.  Several better choices are mentioned here

     
    Regards, Jon Summers
    LA Solutions