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 VS2022 - Code compiles fine using Release configuration but not when switch to Debug (Read 1445 times)
maxedthunder
Newbies
*
Offline


Posts: 7
Joined: May 4th, 2023
VS2022 - Code compiles fine using Release configuration but not when switch to Debug
Nov 30th, 2023 at 6:39am
Print Post  
I am using serial debugger with custom board based on ESP32-MINI-1. The code is mildly complex with couple .cpp files. It compiles and runs fine in Release mode, but as soon as I select Debug mode and try to compile it fails with the following:

error: expected unqualified-id before 'if

The location where it points in the code has nothing unusual and as I said above it compiles fine as is in Release mode.

I tried removing ALL breakpoints and I get the same outcome.

Any help is appreciated.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2769
Joined: Feb 13th, 2019
Re: VS2022 - Code compiles fine using Release configuration but not when switch to Debug
Reply #1 - Nov 30th, 2023 at 9:46am
Print Post  
Thanks for the report.

From the logs sent by email, I suspect the issue is how the loop() function is written:
void loop(void){}

If you change this to have the curly braces on separate lines it should then work as expected:
void loop(void){
}

  
Back to top
IP Logged
 
maxedthunder
Newbies
*
Offline


Posts: 7
Joined: May 4th, 2023
Re: VS2022 - Code compiles fine using Release configuration but not when switch to Debug
Reply #2 - Nov 30th, 2023 at 7:05pm
Print Post  
Yes, that was it! Very strange but glad it compiles because after spending several hours on this I started thinking some kind of witchcraft is involved! Glad I reached out. Thank you!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint