My code is as follows:
#include <Mstn\MdlApi\MdlApi.h>#include <Mstn\cmdlist.r.h>#include <Mstn\MdlApi\msnativewindow.h>#include <windows.h>#include <DgnPlatform\DgnFile.h>#include <DgnPlatform\DgnFileIO\DgnFileIOApi.h>
extern "C" DLLEXPORT void MdlMain(int argc, WCharCP argv[]){ HWND hWnd = NULL; hWnd = (HWND)mdlNativeWindow_getMainHandle(0);
return;
}
I can't able to resolve these build errors.
Rajesh Varatharajan said:I can't able to resolve these build errors
What is your colourful development environment? Are you using bmake in the SDK command shell?
Regards, Jon Summers LA Solutions
Hi Jon,
Its Visual Studio 2017. Opened Visual Studio 2017 using devenv command in SDK command shell.
Regards
Rajesh
Rajesh Varatharajan said:Opened Visual Studio 2017 using devenv command in SDK command shell.
It's not what Jon asked about.
It's crucial to know whether you use bmake with mke file to build your application. It can be started manually from SDK shell or Visual Studio can be configured to call bmake instead of MSBuild.
If you compile the code without bmake, but using Visual Studio building process, it's your responsibility, because bmake is the only standard tool how to compile code.
It does not mean Visual Studio cannot be used to build the application, but to configure everything how it should be to produce the same code as bmakes does, requires very good knowledge of the compilation process, VS project configuration and all compiler and linker switches.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr said:It's crucial to know whether you use bmake with mke file to build your application. It can be started manually from SDK shell or Visual Studio can be configured to call bmake instead of MSBuild.
I have used bmake in visual studio to build my application.
Rajesh Varatharajan said:I have used bmake in visual studio to build my application.
In such case my previous advice is valid I guess: The error message is clear and using its identifier it's possible to find details about the problem (but "redefinition" is obvious I think).
Analyze detail compilation log (when necessary, switch compiler to produce as detail as possible output). Check what headers are included and types are defined twice.
Regards,
Plus, start bmake manually from SDK shell to ensure Visual Studio does not filter anything out.
To stick on Visual Studio GUI too much is counterproductive often: To be able to run the whole process manually is necessary knowledge and it often provides good insight where the problem can be.