Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8075845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:07:30+00:00 2026-06-05T15:07:30+00:00

From my earlier post , I figured out why the command build /nmake USER_C_FLAGS=/DMyVersion=3

  • 0

From my earlier post, I figured out why the command

build /nmake "USER_C_FLAGS=/DMyVersion=3"

doesn’t associate the define MyVersion with value 3. MSDN says that –

Compiling with /Dname= causes the symbol to not have an associated
value. So, while the symbol can still be used to conditionally compile
code, the symbol will otherwise evaluate to nothing. For example, in
the previous sample program, compiling with /DTEST= will cause a
compiler error. This behavior is similar to using #define with or
without a value.

I have an environment variable that gets set up at run-time and I need to pass that env. variable to the Visual Studio 2005 Makefile Project. Now the question is, how can I pass the env. variable to the run-time build environment ? Once passed, I should be able to something like –

#define VERSION 11

#ifdef BUILD_VERSION       // How to get this macro to the current env. ?
   #undef VERSION
   #define VERSION BUILD_VERSION
#endif

#define FILE_VERSION VERSION

I don’t see any flags from nmake documentation to pass env. variables. Any ideas are highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:07:32+00:00Added an answer on June 5, 2026 at 3:07 pm

    MSDN will answer this for nmake Environment-Variable Macros.

    Pay attention here: “Use the /E option to cause macros inherited from environment variables to override any macros with the same name in the makefile.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following on from a post I made earlier, I am making progress with what
I have a solution from an earlier post that was kindly provided by Dimitre
From an earlier post about trying to improve my sites performance I have been
From earlier SO post i found that for Greasemonkey script to be compatible with
This question is continuation from my earlier post titled selecting digits from regular expression.
As per my earlier post i was able to build a multi-threaded server client
following on from an earlier post: Adding a search form using a DateTime template
Extending to my own question from My Earlier post If you notice i am
Following on from my earlier question about creating Address Books (many thanks Peter!), I
Following up from an earlier question on extracting the n'th regex match , I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.