FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

building a D application with win32 resources

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
StefanLi



Joined: 29 Mar 2006
Posts: 3

PostPosted: Thu Mar 30, 2006 5:41 am    Post subject: building a D application with win32 resources Reply with quote

I am using D to develop a simple Win32 application and I want to use Win32 resources (icons, strings, ..). I inserted

[code]version ( build ) { pragma( build, "boot.rc"); }[/code]

into the main D source file, added a rule definition file (default.rdf), looking like:

[code]----- Windows Resource Compiler -----
This uses ` pragma(/b'build', <sourcefile>.rc); `
-------------------------------------
rule=Resources
source=rc
target=res
tool=rcc.exe {@IN} -32 -r[/code]

While it seems that build recognises this all, it does not call rcc and it does not generate an entry within the .def file.

Any idea what went wrong?
Back to top
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Thu Mar 30, 2006 8:55 am    Post subject: Re: building a D application with win32 resources Reply with quote

StefanLi wrote:
I am using D to develop a simple Win32 application and I want to use Win32 resources (icons, strings, ..). I inserted

Code:
version ( build ) { pragma( build, "boot.rc"); }


into the main D source file, added a rule definition file (default.rdf), looking like:

Code:
----- Windows Resource Compiler -----
 This uses ` pragma(/b'build', <sourcefile>.rc); `
-------------------------------------
rule=Resources
source=rc
target=res
tool=rcc.exe {@IN} -32 -r


While it seems that build recognises this all, it does not call rcc and it does not generate an entry within the .def file.

Any idea what went wrong?

Because the documentation is wrong. The rule file should look like ...
Code:

----- Windows Resource Compiler -----
 This uses ` pragma('build', <sourcefile>.rc); `
-------------------------------------
rule=Resources
in=rc
out=res
tool=rcc.exe {@IN} -32 -r

_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
StefanLi



Joined: 29 Mar 2006
Posts: 3

PostPosted: Thu Mar 30, 2006 11:41 pm    Post subject: Reply with quote

Nice! That does it!
And adding the -o switch for rcc in default.rdf it puts the *.res file into the correct folder, so that it get linked.
default.rdf is now:
[code]----- Windows Resource Compiler -----
This uses pragma( build , "<sourcefile>.rc"); `
-------------------------------------
rule=Resources
in=rc
out=res
tool=rcc.exe {@IN} -o{@OUT} -32 -r[/code]

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group