Viz Studio 2013 error when include MicrostationAPI.h

Hello,


After one full evening of research, I decided to post my nooby problem here. Basically, I just want to start a microstation project in Viz Studio 2013.

I had both include Microstation :

MicroStation\mdl\include
MicroStation\mdl\MicroStationAPI


Into the main file, I added

#define winNT
#include <MicroStation.API>
BEGIN_BENTLEY_NAMESPACE

That's all, but compiler returns me many error (14), these are the 4 firsts :

Error    1    error C2146: syntax error : missing ';' before identifier 'size_type'    c:\users\tom\bentley\microstation\mdl\include\memutilallocator.h    42    1    MdlTEST
Error    2    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    c:\users\tom\bentley\microstation\mdl\include\memutilallocator.h    42    1    MdlTEST
Error    3    error C2146: syntax error : missing ';' before identifier 'difference_type'    c:\users\tom\bentley\microstation\mdl\include\memutilallocator.h    43    1    MdlTEST
Error    4    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    c:\users\tom\bentley\microstation\mdl\include\memutilallocator.h    43    1    MdlTEST

Anyway, I cannot do anything, it's always wrong somewhere into these files.

Of course I checked all http://www.la-solutions.co.uk/content/Publications-MDL.htm#ArticleIndexDevTools, thanks Jon, but I couldn't find a solution.

Could you see what's wrong ??

Thank you and have a nice day

Tom

Parents Reply Children
  • Unknown said:

    There is also nice tutorial Learning MDL Step by Step writen by Yongan Fu available in BDN blog.

    I would like to add a supplement. If you've read Learning MicroStation Addins Step by Step, beware of the chapter 9 because author Yongan.Fu used VS 2010 to compile. I am afraid that it is not suggested although no one mentioned it before.

  • Unknown said:
    Beware of the chapter 9 because author Yongan.Fu used VS 2010 to compile

    It's not clear what point you are making.  An AddIn is written using a .NET language.  Any version of Viz Studio can be used to write an AddIn, provided that it is built for the compatible version of the .NET CLR.  Currently the compatible version (for MicroStation V8i) is .NET v3.5.

    A native-code MDL application must use the correct version of C++. Therefore the developer must use the version of Viz Studio that delivers the correct version of C++.  For MicroStation V8i, the correct version is Viz Studio 2005.

    However, in this case the question is: "How do I write an application that opens a DGN file without MicroStation?"  The MicroStation development tools, using any language, do not let you write a stand-alone application that runs without MicroStation.

     
    Regards, Jon Summers
    LA Solutions

  • Unknown said:

    An AddIn is written using a .NET language.  Any version of Viz Studio can be used to write an AddIn, provided that it is built for the compatible version of the .NET CLR.  Currently the compatible version (for MicroStation V8i) is .NET v3.5.

    I am afraid that it is not true and actually I think I did the same things as Tom last week. Here is the result of compiling Addins with VS 2013. It is very similar to what Tom mentioned.

  • Unknown said:
    I am afraid that it is not true

    It's true and Jon is right, it's possible to use any version of Visual Studio to create MicroStation add-in, as far as a code is compiled into CIL for CLR 2.0 (which is used in NET 2.0 - 3.5). Any NET language can be used like C#, VB.NET or C++/CLI.

    Based on what I can see at your screen capture I guess it's a native C++ project, not NET project? If you have a problem with Visual Studio 2013 and NET add-in (not native C++, because VS 2013 compiler is not supported for MicroStation), post a new thread to this forum. I use VS 2013 every day to work on my C#/NET add-ins for MicroStation and other products, so I am sure it works fine.

    Regards,

      Jan

  • I rewrite the supplement.

    Tom, if you've read Learning MicroStation Addins Step by Step, beware of the chapter 9 because author Yongan.Fu used VS 2010 to compile. Inside the chapter 9 he was using native C++ code. I am afraid that it is not suggested although no one mentioned it before.

  • C++ Compiler: Missing Header Files

    Unknown said:
    Here is the result of compiling Addins with VS 2013

    The error messages in your screenshot have nothing to do with the version of Viz Studio.  They are caused by missing header (*.h) files. The compiler is telling you that it cannot find the definition of various typedefs.  You will have the same error messages with any C++ compiler if it cannot find the definitions of all types used in the source code.

    .NET CLR

    Your experience with the C++ compiler is unrelated to .NET.  When you build a .NET AddIn you are using a set of Microsoft tools quite unrelated to those used to build a DLL.

    I think Jan has answered your question about the .NET CLR runtime.

     
    Regards, Jon Summers
    LA Solutions

  • Unknown said:

    The error messages in your screenshot have nothing to do with the version of Viz Studio

    NoNoNo....it is incorrect. If you want to avoid the memutilallocator error from Viz Studio 2013. 

    You need to 

    1. Install VS 2010
    2. Set the VC (2010)'s include, lib, SDK path at VS2013
    3. Set Platform Toolset to any version, say v90, v10, but not v120

    And then you will be able to compile it successfully in VS 2013 without memutilallocator error.

    Just treat this case as ended. Tom actually didn't tell what is his "Project"' nature (MDL? C++ DLL?) at the very first time.