Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 2nd, 2008, 09:05 PM
=?Utf-8?B?Q2hhcmxlcyBS?=
Guest
 
Posts: n/a
Default How do I use diffferent version values in different executables?

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

  #2  
Old September 3rd, 2008, 12:15 AM
Pavel A.
Guest
 
Posts: n/a
Default Re: How do I use diffferent version values in different executables?

_MSC_VER ?

Charles R wrote:
Quote:
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
>
  #3  
Old September 3rd, 2008, 03:35 AM
=?Utf-8?B?Q2hhcmxlcyBS?=
Guest
 
Posts: n/a
Default Re: How do I use diffferent version values in different executable

Not sure I understand what your saying.

"Pavel A." wrote:
Quote:
_MSC_VER ?
>
Charles R wrote:
Quote:
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
>
  #4  
Old September 3rd, 2008, 11:35 AM
David Wilkinson
Guest
 
Posts: n/a
Default Re: How do I use diffferent version values in different executable

Charles R wrote:
Quote:
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.

--
David Wilkinson
Visual C++ MVP
  #5  
Old September 3rd, 2008, 08:35 PM
Pavel A.
Guest
 
Posts: n/a
Default Re: How do I use diffferent version values in different executable

Charles R wrote:
Quote:
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


Quote:
"Pavel A." wrote:
>
Quote:
>_MSC_VER ?
>>
>Charles R wrote:
Quote:
>>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
>>>
  #6  
Old September 3rd, 2008, 08:45 PM
Ben Voigt [C++ MVP]
Guest
 
Posts: n/a
Default Re: How do I use diffferent version values in different executable

Pavel A. wrote:
Quote:
Charles R wrote:
Quote:
>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.
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.
Quote:
>
--PA
>
>
>
Quote:
>"Pavel A." wrote:
>>
Quote:
>>_MSC_VER ?
>>>
>>Charles R wrote:
>>>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

  #7  
Old September 3rd, 2008, 09:05 PM
Pavel A.
Guest
 
Posts: n/a
Default Re: How do I use diffferent version values in different executable

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


Ben Voigt [C++ MVP] wrote:
Quote:
Pavel A. wrote:
Quote:
>Charles R wrote:
Quote:
>>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.
>
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.
>
Quote:
>--PA
>>
>>
>>
Quote:
>>"Pavel A." wrote:
>>>
>>>_MSC_VER ?
>>>>
>>>Charles R wrote:
>>>>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
>
>
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles