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 8938667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:40:55+00:00 2026-06-15T10:40:55+00:00

I am using the following code in a make file to access a variable

  • 0

I am using the following code in a make file to access a variable VENDOR_NAME from a CPP file.

EXTRA_DEFINE += -DVENDOR_NAME=$(VENDOR_NAME)
VENDOR_NAME contains a string.

In my cpp file when I try to use this variable I am getting errors as given below.

cout << VENDOR_NAME;

Feature1.cpp.bak.cpp:8: ‘Default_Vendor’ undeclared (first use this function)
Feature1.cpp.bak.cpp:8: (Each undeclared identifier is reported only once for

I guess this is because my string does not contain double quotes and compiler is considering content of VENDOR_NAME as a variable.

How to get this variable as a string in my CPP file so that I can use it like I have #defineed it?

Thanks…

  • 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-15T10:40:57+00:00Added an answer on June 15, 2026 at 10:40 am

    Your makefile is going to create a command line for the compiler. The problem that arises is that if you just surround the value in quotes:

    EXTRA_DEFINE += -DVENDOR_NAME="$(VENDOR_NAME)"
    

    …the shell will see the quotes as simply delineating a command line argument, so it’ll probably strip them off (though it can depend on the shell you’re using). To prevent that, you’ll want to create the argument with escaped quotes:

    EXTRA_DEFINE += -DVENDOR_NAME="\"$(VENDOR_NAME)\""
    

    I think most of the typical shells, at least for Windows and Linux, will accept a back-slash as an escape to preserve the quotes, but I’m sure there’s at least one around for which you’ll have to do the quoting differently.

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

Sidebar

Related Questions

I'm using the following code to try to make a back button for my
I am using the following code in c# to download a file from my
I am using the following code to make a HttpWebRequest and render the XML
I am using the following code to get make an IMAP connection. I am
I'm using the following code to just make a single UILabel on my cell.
I'm currently facing new problem with operators. Using following code, I want to make
I am trying to compile my gcc code using the following make command .
Using following code I try to get updated list of checkbuttons' corresponding text values,
I am creating date using following code try { newdatetime = new DateTime(2012, 2,
I am using the following code below: import smtplib import zipfile import tempfile from

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.