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\includeMicroStation\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 MdlTESTError 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 MdlTESTError 3 error C2146: syntax error : missing ';' before identifier 'difference_type' c:\users\tom\bentley\microstation\mdl\include\memutilallocator.h 43 1 MdlTESTError 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
Unknown said: I just want to start a MicroStation project in Viz Studio 2013
When writing a native-code C/C++ application, use the right version of Viz Studio!
Unknown said:#include <MicroStation.API>
No such object MicroStation.API! If it's the header file you want to include, then do this...
#include <MicroStationAPI.h>
Regards, Jon Summers LA Solutions
Yes of course, MicroStation.h
So I am probably using a wrong version, I will try with an old one.
Unknown said:No example compile with bmake, it always stop at the line %include mdl.mki into the mke.
You should solve this problem at first, because it means something is wrong with your development environment. Do you use MicroStation SDK development shell to compile the examples?
If the shell is set correctly, the compilation cannot end with any error. Sometimes it's required to start the shell as administrator, because the compilation may create folders inside MicroStation folder tree; also digital signature is recommended to switch off, but there are minor modifications, that can be easily identified. For sure no problem with missing header files or similar problems.
Unknown said:Anyway, my purpose is to develop a native windows application. As far as I understand these example will produce a DLL, is that right ?
Yes and no. MicroStation is not able to load native dll files directly, so ma file, which works as loader, has to be created also. All SDK examples use this approach.
Unknown said:Should I also use bmake for my native win32 application ?
Yes, it's the recommended tool, you can start it from Visual Studio environment.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Okay, I think I'm lost.
Do you have a good resource that explain how to configure Visual Studio to build a win32 app using the microstation sdk ?
There are materials available in BDN Community. If you are not a member, you should think about to become.
There is also nice tutorial Learning MDL Step by Step writen by Yongan Fu available in BDN blog.
Also at Bentley LEARN Server there is MicroStation Programming Learning Path with videos covering different aspects and areas of MicroStation development.
For me it looks like you skip the first important step: To be sure SDK and Visual Studio are installed correctly. And it's easy, because no configuration (or not too many) is required:
After you will be able to compile examples, it's time to configure Visual Studio. But DevShell and bmake will be stil the main tools.
Unknown said:"unresolved external symbol _mdlSystem_newDesignFile" error, it's probably a lib file missing or something ?
Learn to distinguish between compiler errors and linker errors (collectively build errors). The Viz C++ error code will tell you: compiler errors are a 4-digit number prefixed 'C' and linker errors are a 4-digit number prefixed 'L'.
unresolved external symbol is a linker error. The C++ linker was unable to find the definition of that function. You probably need to add several MDL .lib files to the linker input.
In Viz Studio, use the project properties dialog...
If building with bmake, then specify the library files with the DLM_LIBRARY_FILES macro like this...
DLM_LIBRARY_FILES = $(mdlLibs)BentleyDgn.lib \ $(mdlLibs)toolsubs.lib \ $(mdlLibs)mdlbltin.lib \ $(mdlLibs)rasterlib.lib \ $(mdlLibs)stdutillib.lib \ $(mdlLibs)mdllib.lib \ Shlwapi.lib
Jon : The additional library path is set exactly like in your picture, to the folder mdl/library.
But I have the "unresolved external symbol" error. Is there lib file somewhere else that I am missing ? I just want to use the 3 functions that you said to me previously.
Hello Tom,
is the environment variable MS set in your system?
Regards, Martin
Yes it is, I just checked :
C:\Program Files (x86)\Bentley\Program\MicroStation is its value
If I attempt to compile an example with bmake, I have this error:
BMAKE: Error - Attempting to build with VS 2005 but location is undefined!
(cl.exe is in my path)
Unknown said:Is there lib file somewhere else that I am missing?
Once again, you ask a question that we can't answer without seeing your code.
If you look in the MDL documention, you will find both the header file (required by the compiler) and the library file (required by the linker) for each function. For example...
Description
Required Header
Required Library
Jon, this is my code, really basic:
#define winNT #include "stdafx.h" #include <iostream> #include <mdl.h> #include <mssystem.fdf>
//BEGIN_BENTLEY_NAMESPACEvoid useless() { int fd = mdlSystem_newDesignFile("toto.dgn"); } //END_BENTLEY_NAMESPACE int _tmain() { std::cout << "Hello World!" << std::endl; useless(); return 0; }
Hope it's all right.