compile error trying to convert MDL to CONNECT

I installed VS2019, CONNECT and its SDK and I can compile the examples without a problem..

I am trying convert an MDL from SS3 to CONNECT. It is already in .DLL form and compiles within VS in SS3.

When the compiler gets to the type resource, I get this error:

[== Building D:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\fplcmd.rsc, (D:\fpl\devStudio\fplmdl\src\fplcmd.r) ==]
rcomp @D:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\make.opt
MicroStation Resource Compiler 10.16.01
BMAKE: no rules to build D:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\fpltyp.r
BMAKE: call trace
line: 69, D:\fpl\devStudio\fplmdl\src\fplmdl.mke
Mon Apr 04 15:30:20 2022, elapsed time: 0:00

My make file looks virtually identical to the myapp.mke example that compiles without error. Does anybody have any idea what could be going wrong here?

#------------------------------------------------------------------------
# Generate command table include & resource file using rcomp
#------------------------------------------------------------------------
$(o)fplcmd.h : $(baseDir)fplcmd.r

$(o)fplcmd.rsc : $(baseDir)fplcmd.r

#------------------------------------------------------------------------
# Create & compile the app's type resource using rsctype & rcomp
#------------------------------------------------------------------------
$(o)fpltyp.r : $(baseDir)$fpltyp.mt \
$(privateInc)fplids.h

$(o)fpltyp.rsc : $(o)fpltyp.r

#------------------------------------------------
# Set up to use dlmcomp.mki and dlmlink.mki
#------------------------------------------------

  • Hi ,

    There are many changes in: product, code and workflows; between MicroStation V8 and MicroStation CONNECT. We try to put as much information possible under the wiki topic Migrating to CONNECT.  Where one of the first recommendations would be to Migrate V8 MDL Applications To Native Code (V8i to CONNECT).  This helps ensure many coding errors will be caught by the Visual Studio compiler and to ensure the project builds cleanly as a V8 Native Code project.  If this step has been performed, then it is best to review what functionality the new product can effectively replace (commands, utilities and workflows) so-as to eliminate any unnecessary coding (or re-inventing the wheel) and not integrating well within the new product/platform.

    Once you established the necessary code to be migrated there are two approaches/paths to leverage.  Most developers will try to perform a 1:1 migration of source code (line by line); where many times it will be more effective to create a new project, new code and new (modern) APIs to create the most maintainable code most quickly. Given that and your current problem (first encountered) is a problem in the make file, I suggest taking the (very similar) Myapp.mke and Myapp.mki files renaming the app name Myapp to your app name (convention) thereby verifying the source file name (parts) and extensions as being correct and a good starting point for your app to best build cleanly.

    Migrating your first couple source code projects will take more time to process in the beginning until (standard) build and compiler errors become second nature to correct, it is worth noting there are a couple workflow related items in the SDK that may help you find information you need (or provide) more conveniently.

    1. MSCE SDK provides a BUILD command with an optional argument [verbose] to create a standard or verbose log file that you can conveniently zip and attach to your forum posts for others to quickly review and provide feedback.
    2. To conveniently and comprehensively search the local SDK and Product resources, and/or MicroStation Programming Forum: see:
      1. SDKSEARCH SearchTerm [verbose]
      2. SDKTIPS and SDKMACROS
    3. To learn more about the new MicroStation CONNECT APIs, see:
      1. Developer TrainingMicroStation CONNECT Developer Training
      2. CONNECT APIs
    4. For 1:1 Migration, see: Migration Tools

    HTH,
    Bob



  • $(o)fpltyp.r : $(baseDir)$fpltyp.mt \
    $(privateInc)fplids.h $(o)fpltyp.rsc : $(o)fpltyp.r

    make files are sensitive to white space and line feeds. Try this...

    $(o)fpltyp.r : $(baseDir)$fpltyp.mt  $(privateInc)fplids.h
    
    $(o)fpltyp.rsc : $(o)fpltyp.r

     
    Regards, Jon Summers
    LA Solutions

  • I had to copy over myapp.mke to get passed this error. Now here is the next one...

    [== Building D:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\fplmdltyp.r, (D:\fpl\devStudio\fplmdl\src\fplmdl.h) ==]
    rsctype @D:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\make.opt
    MicroStation Type Resource File Generator 10.16.01
    C:\MDLC\include\Mstn\MdlApi\mselems.h(11) : error: can't open #include file math.h
    C:\MDLC\include\Mstn\MdlApi\mselems.h(11) : error: No such file or directory
    C:\MDLC\include\Bentley/Bentley.h(46) : error: "This file is for C++ compilands only"
    C:\MDLC\include\Bentley/suppress_warnings.h(11) : warning: pragma not recognized.
    C:\MDLC\include\Bentley/suppress_warnings.h(12) : warning: pragma not recognized.

    Thanks for your help. 

    Ken

  • Hi ,

    For future (new) errors, please create new posts to help ensure when users search they can quickly find and resolve each unique issue.

    A couple necessary data points for migrating existing code:

    1. Build and Compile your application code projects from within the MicroStation Developer Shell (Run as admin). 
    2. Note many .h files that contained MicroStation Resources (compiled to - .rsc) should exclusively be placed in .r.h (resource file headers) in CONNECT.
    3. For MSCE code projects it is required and most convenient to verify your make file has two lines like in MyApp, like this:
      myapp.mke:11:MDLMKI = $(MSMDE)mki/
      myapp.mke:12:PolicyFile = $(MDLMKI)MicroStationPolicy.mki
    4. In your app's .cpp file I suggest to start by commenting out all includes and starting with just this one (#include <Mstn\MdlApi\MdlApi.h>) and incrementally expand adding additional headers as needed.  If you have many CPP files you could simplify by creating a single (1) YourAppIncludes.h and maintain a single list there. It's really a personal and design decision you can try to help improve speed, efficiency and consistency in your migration.

    HTH,
    Bob



  • C:\MDLC\include\Mstn\MdlApi\mselems.h(11) : error: can't open #include file math.h

    Are you building your app from the SDK command shell?  All paths to header files should be resolved when using that command shell.

     
    Regards, Jon Summers
    LA Solutions

  • I am building from the SDK command shell as aministrator. All the included examples I have tried to compile succeeded without error. it does  not seem to like mselems.h specified in my header file during the type resource file generator.

    #include <Mstn\MdlApi\mselems.h>

    Comparing to myapp, I see only .r.h files in the header file. Is that a requirement? I don't see any mselems.r.h file available.

    I tried renaming my header file with a .r.h extension but that made no difference.

  • Hi ,

    From the developer shell, navigate to the folder where your make file is. Type: build verbose. Then review (long sequential file - from bottom up works best) and/or Zip and Attach it so we can get a better idea of what type of problem is being encountered.

    If you need more insight into how file extensions rules and dependencies are processed within the make file system (.mki files) this search can help provide those entry points:

    findstr -snipr "\.[a-z]*\.[a-z].*:$" "%SDKMKI%*.mki"

    Thank you,
    Bob



  • Comparing to myapp, I see only .r.h files in the header file. Is that a requirement?

    Bentley Systems have a convention of specifying .r.h as the extension for header files that are safe to include in a resource file.  To put that another way, it may not be safe to include a .h file in a resource file. 

    If you look at mselems.h you can see that there's not a lot in it except a few #includes.

    Why do you need that header in your type resource?  What is in fplids.h?

     
    Regards, Jon Summers
    LA Solutions

  • Hi ,

    The build log starting at line 1840 indicates it is encountering an include of math.h (C/C++ header) in the resource file generation portion of the build process. I suggest:

    1. Rename your .r files to .r.h.
    2. Update other source code module references with the above
    3. Take a close look in (previous) .r files for include files, compare to some delivered examples for what you may need to include - or - comment out any C/C++ headers then use SD SearchTerm (search for definitions) to locate the correct header(s) to include.
    4. Recompile until any .r.h/.r C++ compiland errors no longer are present

    Target: D:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\fplmdltyp.r
    [== Building D:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\fplmdltyp.r, (D:\fpl\devStudio\fplmdl\src\fplmdl.h) ==]
    rsctype @D:\Users\KWA0GSU\AppData\Local\Temp\Bentley\MicroStationSDK\objects\make.opt
    MicroStation Type Resource File Generator 10.16.01
    C:\MDLC\include\Mstn\MdlApi\mselems.h(11) : error: can't open #include file math.h
    C:\MDLC\include\Mstn\MdlApi\mselems.h(11) : error: No such file or directory
    C:\MDLC\include\Bentley/Bentley.h(46) : error: "This file is for C++ compilands only"

    Bob