Tuesday, 15 January 2013

c++ - Using Macros in Resource File -



c++ - Using Macros in Resource File -

i trying utilize macros auto-generate build version c++ project.

if following, works fine.

versioning.h

... #define version_major 1 #define version_minor 0 ...

 

myapp.rc

... #include "versioning.h" vs_version_info versioninfo fileversion version_major, version_minor, 0, 0 productversion version_major, version_minor, 0, 0 fileflagsmask 0x3fl ...

 

however, if seek , include more complex, such math, compiler generates errors

#define version_major (2 / 2) error rc1013: mismatched parentheses error rc2104: undefined keyword or key name: /

 

i need utilize much more complex mathematical expressions, phone call other classes, perform string comparison, etc. within macro.

my guess there not wrong macros writing, rather problem way resource file handles macros.

any ideas?

note: using visual studio ultimate 2013 update 3.

a resource compiler not flexible source code compiler. cannot utilize complex macros in resource script. if need that, have utilize separate preprocessor perform calculations , generate necessary macro values resource compiler use.

c++ visual-studio

No comments:

Post a Comment