This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C1294KCPDT: Eclipse system variables in command line

Part Number: TM4C1294KCPDT


Tool/software: Code Composer Studio

I am trying to create a variable loaded with the contents of windows system variable %computername%.

The previous thread  suggests inserting a flag -DHOSTNAME=%COMPUTERNAME% into the project properties - ARM Compiler.
That doesn't seem to work:

-D__HOSTNAME__=%COMPUTERNAME%
expands as a command-line string:
--define=__HOSTNAME__=%COMPUTERNAME% 
and when referenced as
strcpy(p_txBuffer,__HOSTNAME__);
I am getting error: "../ipb_dbg_uart.c", line 1359: error #29: expected an expression.

During debugging I tried defining the string without using the system environment variable - just to try what may be wrong.
both --define=HOSTNAME=MY_MACHINE or --define=HOSTNAME="MY_MACHINE" yield error #20: identifier "MY_MACHINE" is undefined.
Clearly - the double quotes are "eaten away" in the process.

After lengthy experimenting I got my project build when I escaped the double quote marks:
--define=HOSTNAME=\"MY_MACHINE\"

However, --define=__HOSTNAME__=\"%COMPUTERNAME%\" returns the string "%COMPUTERNAME%" without the substitution for the environment variable.

What am I missing here?

Thanks! Martin