Compiling in windows resources (and DSSS)
Derek Parnell
derek at psych.ward
Sat Nov 17 14:30:23 PST 2007
On Sun, 18 Nov 2007 06:53:59 +0900, Bill Baxter wrote:
> What's the best way to compile in .ico and .rc stuff?
> Does dmd on Windows do any of that for you?
>
> I found that I could call "rcc resources.rc" and then add the resulting
> .res file to the dmd command. Is there a better way?
>
> And for using DSSS how would I add that rc step? Anything better than
> this?:
>
> [main.d]
> prebuild = echo "Compiling resources..."; rcc main.rc
> buildflags += main.res
I know you were not after Bud's way of doing this but here it is anyhow ...
First you have these lines in the 'Rule Definition File' (default.rdf) ...
----- Windows Resource Compiler --------
This uses pragma( build, "<sourcefile>.rc");
----------------
rule=Resources
in=rc
out=res
tool=rc /r {@IN} /fo {@OUT}
Then in your source code you would have something like ...
version(build) pragma(build, "main.rc");
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
More information about the Digitalmars-d-learn
mailing list