[CONNECT Update 16.0 C++] Microsoft resource compiler switch

bmake lets us define a C++ compiler switch like this...

nameToDefine=_UNICODE
%include $(MDLMKI)cdefapnd.mki

Macro MDLMKI points to the SDK \mki folder.

Those lines mean...

  1. Assign value _UNICODE to macro nameToDefine
  2. Call the make include file cdefapnd.mki to pass the option (-d_UNICODE) to the C++ compiler

A similar idiom lets us define an include folder for the C++ compiler...

dirToSearch = $(geometry)
%include $(MDLMKI)cincapnd.mki

Are similar macros available to define switches for the Microsoft resource compiler?  I ask because I'm looking at moving to Viz Studio 2019.  Unfortunately the Viz Studio 2019 resource compiler is broken and doesn't look in the right folder to find Microsoft header file afxres.h.  I can fix the problem by hard-wiring the path to that file in the project resource (.rc) file...

#include "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/atlmfc/include/afxres.h"

I'd prefer not to do that.  If a resource compiler switch were available, I could write something akin to the dirToSearch lines above.  Or is there another way to define Microsoft resource compiler options?

Microsoft describes their resource compiler (RC.exe) and its command-line switches here.

Note: in case it's not obvious, this question is about using bmake to control the Viz Studio resource compiler.  I'm not asking about the MDL resource compiler.

Parents
  • Hi ,

    From what I can tell (findings below) after calling mdl.mki you *may* be able to influence (update or append additional) include path(s) to mfcInc that would be used to define the atlmfc folder location where afxres.h resides.  If needed you may want to run bmake with verbose logging (+avilC) and capture output to a build log to verify how successful this can influence the process.  Also, MSCE U16.1 SDK supporting VS2019 should be available in the coming weeks if this could wait or, the suggested does not pan out.

    HTH,
    Bob

    Every MDL application using bmake and respective MKI files should first include:
    	
    	%include $(MDLMKI)mdl.mki
    
    Where mdl.mki includes/calls(">") additional mki files that further define respective platform and compiler specific: Macros, Cmds, and Locations/Paths.
    Given that, the path (and macro variables) to define the ATL include folder is constructed as... 
    
    Mdl.mki > ConfigurePolicy.mki > AssertToolSet.mki
       - Sets MSVCDir=VCToolsInstallDir
    AssertToolSet.mki > winntmdl.mki
    	- Sets ntTools=$(MSVCDir)/
    	- Sets mfcInc = ${ntTools}/atlmfc/include/  /* ATL Includes */
    
    Given that, if you were to inspect and/or redefine mfcInc after calling MDL.MKI you (theoretically) should be able to override and/or append your own path(s).
    



  • From what I can tell (findings below) after calling mdl.mki you *may* be able to influence (update or append additional) include path(s) to mfcInc that would be used to define the atlmfc folder location where afxres.h resides

    The problem is that the include .mki macros set switches for the C++ compiler.  Those don't affect Microsoft's resource compiler.

     
    Regards, Jon Summers
    LA Solutions

  • Hi,

    This is a guess but in winntmdl.mki are the lines.

    .rc.res:
    $(msg)
    rc $(rcOpt) -d$(rcCPU) -dwinNT $(ProductRcIncludes) $(rcExtraOpts) -r -fo$@ $%$*.rc
    ~time

    Which I think execute rc.exe, you should be able to append to either rcOpt or rcExtraOpts to do what you need ?

    Paul



    Answer Verified By: Jon Summers 

  • In winntmdl.mki are the lines

    Thanks for the hint. This is what I added to my bmake file...

    #  Beware of line-wrapping
    atlmfc = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC
              /Tools/MSVC/14.29.30133/atlmfc/include"
    rcExtraOpts + -i $(atlmfc)
    

    First, we define a macro atlmfc that specifies a folder.  Note these details...

    1. The path is quoted because it contains spaces
    2. The path is not terminated with a slash
    3. There is not a hard return between VC and /Tools.  It's all one line

    Next we append the include (-i) switch with the folder macro (atlmfc) to macro rcExtraOpts.

    • There is an intentional space between switch -i and the include path

    When we invoke the make rule in the bmake file then the include file you mention (winntmdl.mki) uses the macro (rcExtraOpts) defined above...

    $(tempObjects)Annotator.res  : $(baseDir)Annotator.rc $(baseDir)resource.h 
    

    When we build the project bmake emits the following...

    [== Building Q:\CONNECT\Annotator\MasterPlanner\objects\MasterPlanner\Annotator.res, 
        (Q:\CONNECT\Annotator\MasterPlanner\Annotator.rc) ==]
    rc -d -dVARIETY= -dUSER="\"CONNECT on CELERATRIX64\"" -d_X64_ -dwinNT  
       -i "C:\Program Files (x86)\Microsoft Visual Studio\
       2019\Community\VC\Tools\MSVC\14.29.30133\atlmfc\include" 
       -r -foQ:\CONNECT\Annotator\MasterPlanner\objects\MasterPlanner\Annotator.res
       Q:\CONNECT\Annotator\MasterPlanner\Annotator.rc
    Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

    The include switch (-i) is the blue text.

     
    Regards, Jon Summers
    LA Solutions

Reply
  • In winntmdl.mki are the lines

    Thanks for the hint. This is what I added to my bmake file...

    #  Beware of line-wrapping
    atlmfc = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC
              /Tools/MSVC/14.29.30133/atlmfc/include"
    rcExtraOpts + -i $(atlmfc)
    

    First, we define a macro atlmfc that specifies a folder.  Note these details...

    1. The path is quoted because it contains spaces
    2. The path is not terminated with a slash
    3. There is not a hard return between VC and /Tools.  It's all one line

    Next we append the include (-i) switch with the folder macro (atlmfc) to macro rcExtraOpts.

    • There is an intentional space between switch -i and the include path

    When we invoke the make rule in the bmake file then the include file you mention (winntmdl.mki) uses the macro (rcExtraOpts) defined above...

    $(tempObjects)Annotator.res  : $(baseDir)Annotator.rc $(baseDir)resource.h 
    

    When we build the project bmake emits the following...

    [== Building Q:\CONNECT\Annotator\MasterPlanner\objects\MasterPlanner\Annotator.res, 
        (Q:\CONNECT\Annotator\MasterPlanner\Annotator.rc) ==]
    rc -d -dVARIETY= -dUSER="\"CONNECT on CELERATRIX64\"" -d_X64_ -dwinNT  
       -i "C:\Program Files (x86)\Microsoft Visual Studio\
       2019\Community\VC\Tools\MSVC\14.29.30133\atlmfc\include" 
       -r -foQ:\CONNECT\Annotator\MasterPlanner\objects\MasterPlanner\Annotator.res
       Q:\CONNECT\Annotator\MasterPlanner\Annotator.rc
    Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

    The include switch (-i) is the blue text.

     
    Regards, Jon Summers
    LA Solutions

Children
No Data