How do I use diffferent version values in different executables?

C

Charles R

I have two different executables that I want to build w/ the same source but
in 2 different compilers, vs60 and vs2008. I have 2 different configurations
w/ different options etc, but I want one to be version 1.0 and another 3.0.

Anyway to do this easily using the same .rc file? I couldnt figure how to
use the condition property of the VERSION. I did this years ago, but forgot.
I tried defining a condition parameter, then adding it to the Preprocessor
definitions in the configurations, but both executables always had the same
version.

Any ideas? TIA
-C
 
D

David Wilkinson

Charles said:
Not sure I understand what your saying.

Charles:

You have asked this same question separately in several groups. This
"multi-posting" is very bad newsgroup etiquette. I suggest you use the replies
in the the group

microsoft.public.vc.ide_general

because that is where you have received the most replies.

You might also find that these newsgroups are much easier to use if you use a
newsreader such as those contained in the free Outlook Express or Mozilla
Thunderbird.
 
P

Pavel A.

Charles said:
Not sure I understand what your saying.

_MSC_VER is a predefined macro that equals to the compiler version.
So you can use it for conditional compilation, to distinguish between
VC6 and 2008.

--PA
 
B

Ben Voigt [C++ MVP]

Pavel said:
_MSC_VER is a predefined macro that equals to the compiler version.
So you can use it for conditional compilation, to distinguish between
VC6 and 2008.

But only set by the C or C++ compiler, I believe. While the VERSION
resource is processed by the resource compiler, rc.exe.

However setting preprocessor defines in the project settings should work,
but some manual editing of the .rc file may be necessary to make it work.
 
P

Pavel A.

You're right! the question was about rc file.
Then, how about a pre-build step that will run
cl <enter>, parse the version number out of the output, and produce
an include for a rc2 file. Put the version resource into .rc2 to avoid
creating it automatically.

--PA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top