Hi Mohammad,
at first, please use Syntax highlighter tool (yellow pencil icon) with correctly set language when you post any code. It will ensure your code will be properly formatted and colorized and as such easy readable.
[quote user="Mohammad Aryafar"]I have searched through out this forum and other sources but most of answers are related to C++ or VBA. [/quote]
This is because VBA is the most often use API in MicroStation VBA and C++ is the primary MicroStation API now (in CONNECT Edition). But even though the code is C++, very often MDL C functions are used.
[quote user="Mohammad Aryafar"]I'm using Micostation V8 2004 and developing in C language at the moment. [/quote]
To be exact, you are not. What you are using is MDL pseudocode compilation (mcomp, rcomp) and not native C/C++ compilation using Visual C compiler. From the language point of view differences are minor, but comparing to native C code behaviour some exist.
You should be aware you are using very old MicroStation version and development environment that is not supported anymore. In my opinion for MDL learning it's not big issue at the beginning, because MDL functions are the same in V8 2004 Edition using mcomp and in V8i using Visual Studio 2005 compiler. But later it may play more important role (and to use native C/C++ allows to use external libraries like Boost which can be a big benefit in some situations).
[quote user="Mohammad Aryafar"]When I run the command: mcomp[/quote]
It's recommended to create make file (.mke) and to use bmake to build you application, because it will take care about everything. I started (many years ago in MicroStation 4.0 ;-) in the same way and it's good, because you will understand the whole process (what tools and in what order are used), but it's not flexible enough for more complex projects.
[quote user="Mohammad Aryafar"]Can anyone tell me what am I doing wrong here?[/quote]
I don't see any linked library in your mlink call. I guess you have to tell mlink it should link your object will with builtin.dlo library.
I guess you know how C compilation process (compile all object files, linke the object files together with all required applications...) works?
With regards,
Jan