Ask a questionAsk a question
 

Answermessage compilation (MC.exe)

  • Friday, May 08, 2009 7:27 AMsenapanch Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Dear Reader

      I have done a custom build for compiling the message file (SampleMessage.mc) using VS05 and getting compling error as::

    Steps:

    Right click on the SampleMessages.mc file in the Workspace, and choose "Settings...". The "Project Settings" dialog comes up:

    Defining a Custom Build rule for Messages.mc

    Go to the "Custom Build" page and change the "Settings For:" combo to "All Configurations". Then enter the following data:

       1. Enter a description message like "Compiling Messages..." into the "Description" field. This message is later printed into the "Build" window of the IDE if the Messages.mc file is compiled.
       2. Enter the following command line for the message compiler (mc.exe) into the "Commands" field:

          mc.exe -A "$(InputDir)\$(InputName).mc" -r "$(InputDir)\res" -h "$(InputDir)"

       
       3. Add the files that are created by mc.exe to the "Outputs" field. This information is necessary for the build system to determine which parts of the project have to be recompiled if the message file has been modified:

          $(InputDir)\res\$(InputName).rc
              $(InputDir)\$(InputName).h




    is there any other procedure/way to build the Samplemessage.mc files


      1>------ Rebuild All started: Project: SimpleDown, Configuration: Release Win32 ------ 1>Deleting intermediate and output files for project 'SimpleDown', configuration 'Release|Win32' 1>Compiling Messages(MC.exe)... 1>c:\proj\mahender_work\MCTutorial_demo\SimpleDown\\Messages.mc(0) : error : unable to open output file - c:\proj\mahender_work\MCTutorial_demo\SimpleDown"\Messages.h 1>MC: Unable to open c:\proj\mahender_work\MCTutorial_demo\SimpleDown\\Messages.mc for input 1>Project : error PRJ0019: A tool returned an error code from "Compiling Messages(MC.exe)..." 1>Build log was saved at "file://c:\proj\mahender_work\MCTutorial_demo\SimpleDown\Release\BuildLog.htm" 1>SimpleDown - 2 error(s), 0 warning(s) ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

    BULID Log ::

    Build Log
       

    Rebuild started: Project: SimpleDown, Configuration: Debug|Win32


    Command Lines
       
    Creating temporary file "c:\proj\mahender_work\MCTutorial_demo\SimpleDown\Debug\BAT00000E26283176.bat" with contents
    [
    @echo off

    mc.exe -A "c:\proj\mahender_work\MCTutorial_demo\SimpleDown\\Messages.mc" -r "c:\proj\mahender_work\MCTutorial_demo\SimpleDown\\res" -h "c:\proj\mahender_work\MCTutorial_demo\SimpleDown\"

    if errorlevel 1 goto VCReportError

    goto VCEnd

    :VCReportError

    echo Project : error PRJ0019: A tool returned an error code from "Compiling Messages(MC.exe)..."

    exit 1

    :VCEnd
    ]
    Creating command line "c:\proj\mahender_work\MCTutorial_demo\SimpleDown\Debug\BAT00000E26283176.bat"
    Output Window
       
    Compiling Messages(MC.exe)...
    c:\proj\mahender_work\MCTutorial_demo\SimpleDown\\Messages.mc(0) : error : unable to open output file - c:\proj\mahender_work\MCTutorial_demo\SimpleDown"\Messages.h
    MC: Unable to open c:\proj\mahender_work\MCTutorial_demo\SimpleDown\\Messages.mc for input
    Project : error PRJ0019: A tool returned an error code from "Compiling Messages(MC.exe)..."
    Results
       
    Build log was saved at "file://c:\proj\mahender_work\MCTutorial_demo\SimpleDown\Debug\BuildLog.htm"
    SimpleDown - 2 error(s), 0 warning(s)

    Alternative way to build the message.mc files ?

     Plz.. suggest me thanks



    Regards ,

    mahender

Answers

  • Monday, May 11, 2009 9:00 AMViorel_MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    On Step 2, make sure the command is entered in a single line.

     

    I would suggest adding of “echo” line just to see which command the compiler is trying to execute. Click on “…” button in Command Line field and type the following three lines:

     

    @echo on

    mc.exe -r "$(InputDir)res" -h "$(InputDir)" "$(InputDir)$(InputName).mc"

    @echo Done.

     

    or

     

    @echo on

    mc.exe -r "$(InputDir)res" -h . "$(InputPath)"

    @echo Done.

     

    During compilation check in Output panel if the “mc.exe” command is correct. This message compiler can be executed manually too. Command line options are described in MSDN documentation: http://msdn.microsoft.com/en-us/library/aa385638(VS.85).aspx.

All Replies

  • Friday, May 08, 2009 8:12 AMViorel_MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code

    Since $(InputDir) already includes trailing “\”, try changing from “$(InputDir)\” to “$(InputDir)” in several places, and show us new errors.

  • Monday, May 11, 2009 7:49 AMsenapanch Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi, Viorel
    thnx for suggestion .

    I hv'e changed according to the above mentioned in

     step 2: 
        mc.exe -r "$(InputDir)res"
            -h "$(InputDir)"    "$(InputDir)$(InputName).mc"

    step 3:

    $(InputDir)res\$(InputName).rc;$(InputDir)$(InputName).h


    However the issue is not solved the below is the error details:



    1>------ Build started: Project: SimpleDown, Configuration: Release Win32 ------
    1>Compiling Messages(MC.exe)...
    1>c:\proj\mahender_work\MCTutorial_demo\SimpleDown"    c:\proj\mahender_work\MCTutorial_demo\SimpleDown\Messages.mc(0) : error : unable to open input file
    1>MC: Unable to open c:\proj\mahender_work\MCTutorial_demo\SimpleDown"    c:\proj\mahender_work\MCTutorial_demo\SimpleDown\Messages.mc for input
    1>Project : error PRJ0019: A tool returned an error code from "Compiling Messages(MC.exe)..."
    1>Build log was saved at "file://c:\proj\mahender_work\MCTutorial_demo\SimpleDown\Release\BuildLog.htm"


    Is there any alternate way to build messages ? and where can i find the MC.exe tool?

    Thanks,

    Regards
    Mahender


  • Monday, May 11, 2009 9:00 AMViorel_MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    On Step 2, make sure the command is entered in a single line.

     

    I would suggest adding of “echo” line just to see which command the compiler is trying to execute. Click on “…” button in Command Line field and type the following three lines:

     

    @echo on

    mc.exe -r "$(InputDir)res" -h "$(InputDir)" "$(InputDir)$(InputName).mc"

    @echo Done.

     

    or

     

    @echo on

    mc.exe -r "$(InputDir)res" -h . "$(InputPath)"

    @echo Done.

     

    During compilation check in Output panel if the “mc.exe” command is correct. This message compiler can be executed manually too. Command line options are described in MSDN documentation: http://msdn.microsoft.com/en-us/library/aa385638(VS.85).aspx.