Can anyone list the specific and detailed steps to configure mc.exe (the message compiler) to compile a .mc file into a .rc file as a custom compiler step in VC++ 2010?
I am really lost on how to do this.
views:
181answers:
2
+1
A:
Right-click the project, Add + New Item, select Text File, name it Blah.mc. Enter or paste the definitions. Right-click Blah.mc, Properties, Custom build step:
- Command line = mc $(InputPath)
- Outputs = $(InputName).rc
Edit your .rc file, add:
#include "Blah.rc"
Worked for me, ought to be close.
Hans Passant
2010-06-12 00:06:28
Prgress, but did you mean: Command line = mc $(InputName).mc Outputs = $(InputName).rc; $(InputName).h Regardless, this gives the error: mc : error : 0x2 trying to open file <.mc>.
EMS
2010-06-12 01:00:25
OK, I am starting to think there is a bigger problem. I make a TextFile.txt, then configured: Command line = echo "InputDir=" $(InputDir) "InputName=" $(InputName) >TextOut.txt Outputs = TextOut.txt TextOut.txt does not contain the $(xxx) macro expansions. Does not look right.
EMS
2010-06-12 02:11:03
Not sure what you are doing. Make sure the filename extension is .mc, not .txt
Hans Passant
2010-06-12 08:03:42
Thanks for your help. Macro names $(InputName), $(InputPath) are blank for me in the custom build step. "mc.exe" fails, claiming no args. In the above "echo" test, I try to echo the macro expensions to a file, but also come up blank there too. Could this be a bug?
EMS
2010-06-12 11:11:31
There's more than one Custom Build Step. Did you follow my instructions? *Right-click the .mc file* in the Solution Explorer window.
Hans Passant
2010-06-12 12:25:10
A:
If you want to use a Custom Build Rule, you can do this
- Right click your project in Visual Studio -> Custom Build Rules
- Click "New Rule File" and fill out the fields, I use this rule file for MC.EXE
tonto
2010-07-07 22:15:18