BMAKE Error

When I try to  BMAKE to compile a MDL application, I get the folliwing error:

BMAKE: Error - Attempting to build with VS 2005 but location is undefined!

My computer has the following Visual Studios installed:

Visual Studio 2003 Professional

Visual C# 2005 Express Edition

Visual C# 2008 Express Edition

Visual Basic 2008 Express Edition

Visual Web Developer 2008 Express Edition

 

 

  • FYI: I did install the Visual Studio 2005 with C++ complier, that didn't hurt any.  However, my main problem with my existing MDL applications was my use of NULL in the mdlElmdscr_display  function.  This causes V8i to crash.  I got my himts about this from thread 22913.  After correcting to mdlElmdscr_display (inEdP, mdlModelRef_getActive (), NORMALDRAW), everything is working just fine.  Thanks again - Myron
  • Thanks Jon, Phil, Mark and Jan for all your advice and help resolving these questions!
  • mbollman:

    When I tried re-compiling one of my older MDLs, it compiles alright with the switch (as I still have Visual Studio 6.0, yes it has been a while since I have worked on my MDL applications), but I the program bombs and locks up MicroStation upon calling some functions.

    If you have not, you should take a look in the SDK ReadMe for information on changes to some functions that could be causing that. If there is nothing apparent there, then Jon's suggestion about posting the relevant code is spot on.

      

  • Myron:
    1. Does V8i SDK still uses Visual Studio 2005, not 2008?
    2. Is the Std Edition alright, or is Pro required?
    3. If an MDL is compliled with out VS using the -dNO_COMPILERS_MKI switch, what is lost?
    4. When I tried re-compiling one of my older MDLs, it compiles alright with the switch (as I still have Visual Studio 6.0, yes it has been a while since I have worked on my MDL applications), but I the program bombs and locks up MicroStation upon calling some functions. The same MDL worked fine in V8XM.
    5. I assume your advice is to upgrade to VS 2005 (or higher?) and start debugging?

     

      • Does V8i SDK require Visual Studio 2005?

        No: but we're encouraged to write code in C++ rather than pure MDL (C). For example, the MicroStationAPI is C++ only

      • SDK does not use Visual Studio, but if you have written code in C++ lets you compile it using bmake. There is bmake rule that invokes the Visual C++ compiler when it finds a .cpp file
    1. Is the Std Edition alright, or is Pro required?

      For a modest difference in cost, go for Pro. It provides additional Microsoft tools and database support, including a version of SQL Server

    2. If an MDL is compliled with out VS using the -dNO_COMPILERS_MKI switch, what is lost?

      Nothing: you are building a pure MDL application, just like in the old days. That switch simply tells bmake to ignore the possibility of using anything but the Bentley tools

    3. When I tried re-compiling one of my older MDLs, it compiles alright with the switch but I the program bombs and locks up MicroStation upon calling some functions.

      Post some code that uses a misbehaving function

    4. I assume your advice is to upgrade to VS 2005 (or higher?) and start debugging?

      VS2005 — but not higher.

     

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Mark,

    Thanks for the helpful information.  So to clarify, does V8i SDK still uses Visual Studio 2005, not 2008?  Is the Std Edition alright, or is Pro required. Additionally if an MDL is compliled with out VS using the -dNO_COMPILERS_MKI switch, what is lost?  When I tried re-compiling one of my older MDLs, it compiles alright with the switch (as I still have Visual Studio 6.0, yes it has been a while since I have worked on my MDL applications), but I the program bombs and locks up MicroStation upon calling some functions.  The same MDL worked fine in V8XM.  I assume your advice is to upgrade to VS 2005 (or higher?) and start debugging?  Thanks, Myron

  • Lets step back and solve the first post problem then on a different thread try to figure out the rest of what is in here.  Out of the box MicroStationV8 XM Edition SDK is made to be used with VisualStudio 2003 for compiling native code MDL applications.  We ship the MicroStation Developer Shell (a shortcut on the start menu) based on the MSTNDEVVARS.bat file that is in the mdl\bin directory for where you installed the SDK.  That shell will  look for VS71COMNTOOLS to be set and then run the VSVARS32.BAT file to configure the compiler information.  Just open the shell and you should see that batch file echo out to the screen so you can check things.  Now for the problem areas.  If you are trying to compile and getting a message about not being able to find the compenv  file then you should use the -dNO_COMPILERS_MKI command line switch to stop the build process from trying to run through the AssertToolSet.mki.   The difference between - and + is that the + defines are passed on to the sub process.  If you are having a problem then start with the dev shell batch file to debug the environment.  MKI files are nothing but rules and macros which with a little patients can be sorted out.

    Bmake is not tied to a compiler or any other tool, it simply invokes other tools based on the rules and macros that are defined in the various mki files. 

    The compilers.mki file will go through and set the environment up for the specified tools.

    The AssertToolSet.mki file and the compilers.mki file started in MicroStationV8 XM to allow the use of other compiler tools and have only really flourished in the MicroStation V8i SDK.

    The main MKI file to start with is the MDL.mki file it will further invoke the other pieces.  It will invoke the winntmdl.mki file for the Windows specific items.

    The next most important MKI file is the dlmlink.mki file which builds the native code sections.

    As for the express tools we do not do the checks for these and if you do some research you will find they insert themselves slightly different form the Pro versions.  While I have done some experimenting with them and it is possible to configure the process to work I would stick to the Pro version if possible.

    And this has nothing to do with the development of .NET AddIns they should be treated as a seperate subject.

    HTH,

    mark anderson [Bentley]

    P.S. I use the delivered SDK Shell and try to build all my samples with this using standard make files so that we have an equal starting point.  The first sanity check that one should do is to unpak the examples and go to MYAPP and try to build that one.  Another note.  For the next release all of the examples have been converted to Native Code so you will need VisualStudio to compile them.

     

  • Default BMake Configuration

    DanPaul:
    bmake assumes by default that Visual Studio is installed with the C++ compiler. bmake is complaining that the path to the Visual C++ tools is not defined (as it would be if you had installed Visual C++). This means that all addins are C++ projects, but are using another project (VB, C#, CLI) as reference??

    Not at all: the key phrase above is by default. Make files are extremely versatile. However, they evolved during the early days of UNIX and have inherited the cryptic nature of early UNIX utilities. You can write a make that will do pretty well anything that your operating system and installed toolset allow you to do.

    There are clearly some make experts in Bentley Systems, but as you've no doubt noticed they aren't too hot on documentation or explanation. O'Reilly published a book about make but that's long out of print. They currently list Managing Projects with GNU Make.

    If you can figure out how make works, you will be able to write a bmake file that uses your .NET project. Maybe Mark Anderson can provide more info on this at some future BDN meeting or web session.

    Biagio:
    I got same error short time ago with Visual Studio 2005 Express Edition installed. After I tried on another PC with Visual Studio 2005 Professional installed and then build worked great. I suppose that Bmake compiler engine when find any Visual Studio 2005 Edition installed, it tries to use some build tool that unfortunately is not shipped with the Express Edition.

    You get what you pay for, and you didn't pay anything for Visual Studio 2005 Express Edition. Those free tools omit what Microsoft considers to be stuff for 'professional developers'.

    The cost of Visual Studio 2005 Pro is less than the accumulated cost of the time spent by people answering questions about Express Edition on this forum. If you search the archives you will find that Mark Anderson already commented about this issue.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Riley,

    I got same error short time ago with Visual Studio 2005 Express Edition installed.

    After I tried on another PC with Visual Studio 2005 Professional installed and then buld worked great.

    So I suppose that Bmake compiler engine when find any Visual Studio 2005 Edition installed, it tries to use some build tool that unfortunately is not shipped with the Express Edition or simply BMAKE compiler is not compatible with the Express (and free) Edition.

  • Jon Summers:

    We're encouraged to develop using Visual C++ these days. Part of that encouragement is that bmake assumes by default that Visual Studio is installed with the C++ compiler. bmake is complaining that the path to the Visual C++ tools is not defined (as it would be if you had installed Visual C++).

    This means that all addins are C++ projects, but are using another project (VB, C#, CLI) as reference?? 

  • Myron:
    >bmake <filename> The error returned is: BMAKE Error - Attempting to build with VS 2005 but location is undefined! I understand that this error is coming from the AssertToolSet.mki file, and apparently is not finding the Visual Basic files.

    We're encouraged to develop using Visual C++ these days. Part of that encouragement is that bmake assumes by default that Visual Studio is installed with the C++ compiler. bmake is complaining that the path to the Visual C++ tools is not defined (as it would be if you had installed Visual C++).

    In other words, this has nothing to do with Visual Basic or VB.NET.

    In your case, bmake is looking for macro VS2005Dir, but it's not defined.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions