Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic command-line error: invalid macro definition using Build Properties (Read 4628 times)
chaaarlie2
Newbies
*
Offline


Posts: 5
Joined: Jan 23rd, 2016
command-line error: invalid macro definition using Build Properties
Aug 19th, 2018 at 12:12pm
Print Post  
I am trying to use some Build Properties to upload two 'versions' of the same code to two ESP32 modules, depending on the COM port I have selected within vMicro. 

The code compiles and runs correctly if I manually #define a parameter at the start, but that requires me to add/remove it for every upload. Utilising the build properties should remove this step, so I select the correct board and the code automagically reconfigures.

The problem is that I get the following error from intellisense. The code still compiles correctly, but intellisense is essentially disabled when writing code.

Code
Select All
E0992	command-line error: invalid macro definition: COMPORT {serial.port.num}	<PROJECTNAME> <FILENAME> line #1  



All files within the project have the dreaded red squiggle under the first character, and the error above updates <FILENAME> according to whichever .cpp file is active.

I have tried adding the macro definition to both "Current Configuration" and "Project Global" sections of the Project Properties and the intellisense error remains. The same goes for Debug/Release configs.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: command-line error: invalid macro definition using Build Properties
Reply #1 - Aug 19th, 2018 at 12:39pm
Print Post  
Basically the {serial.port.num} variable is not being resolved because the port is only set in the "build" properties when upload is used. Intellisense has never resolved a port although its worth looking to see if we can in future releases.

The best I can think of right now it to use the configuration comobox to create a configuration that contains some "extra flags" that set the define. Unfortunately the changing configuration can't set the port so you still have to set both port and configuration prior to upload.

Example configuration names:-

Port1 Release
Port2 Release

There is an "Extra flags (configuration)" property where you can put the -D defines. 

This might be a better solution anyway because port numbers can change in some situations.



  
Back to top
IP Logged
 
chaaarlie2
Newbies
*
Offline


Posts: 5
Joined: Jan 23rd, 2016
Re: command-line error: invalid macro definition using Build Properties
Reply #2 - Aug 19th, 2018 at 1:06pm
Print Post  
Thank you for explaining the reason intellisense can't handle it. It's frustrating, but I understand the limitation.

There are no further definitions that are specific to either of the target devices, it's just some print functions that change. Thus I have no need to create individual configurations as one simple #define at the top switches the whole code from device A to device B.

Following on from your comment about future releases, it would be great if one could force some of the selectable options such as COM port, Board Type, etc., to be determined by the configuration.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint