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 Compilation fails in Visual Micro, works in Arduino IDE (STM32duino) (Read 1424 times)
bfrei
Newbies
*
Offline


Posts: 3
Location: Singapore
Joined: Mar 18th, 2021
Compilation fails in Visual Micro, works in Arduino IDE (STM32duino)
Mar 18th, 2021 at 8:47am
Print Post  
Hi, 

I get the following compilation error in Visual Micro, while compilation in the Arduino IDE works fine.

I guess it has to do with the included library code (qp framework), as I can compile a standard "blinky" sketch not using that framework.

BlinkyQP.ino: 26:7: error: expected nested-name-specifier before 'void
   26 | void setup() {
   |       ^~~~

Thanks,
Bernhard
« Last Edit: Mar 18th, 2021 at 8:47am by bfrei »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
bfrei
Newbies
*
Offline


Posts: 3
Location: Singapore
Joined: Mar 18th, 2021
Re: Compilation fails in Visual Micro, works in Arduino IDE (STM32duino)
Reply #1 - Mar 18th, 2021 at 8:50am
Print Post  
Attached the VM project folder and the library.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
bfrei
Newbies
*
Offline


Posts: 3
Location: Singapore
Joined: Mar 18th, 2021
Re: Compilation fails in Visual Micro, works in Arduino IDE (STM32duino)
Reply #2 - Mar 18th, 2021 at 9:02am
Print Post  
Might be some C++ name mangling.

It works in VM if I define setup() as external C:

extern "C" void setup() {...}

Best regards,
Bernhard
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: Compilation fails in Visual Micro, works in Arduino IDE (STM32duino)
Reply #3 - Mar 18th, 2021 at 9:35am
Print Post  
Thanks for the report and the detail around this, we can now replicate the issue and will continue to investigate.

The issue is related to the prototype generation, which in this case is generating an incorrect prototype for the setup() function.

A work around while we investigate further (in this specific case), is to add a dummy variable declaration between "using namespace QP;" and "void setup()"
e.g. 
Code
Select All
using namespace QP;

int dummyVar = 0;

void setup() { 

« Last Edit: Mar 18th, 2021 at 9:41am by Simon@Visual Micro »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: Compilation fails in Visual Micro, works in Arduino IDE (STM32duino)
Reply #4 - Mar 19th, 2021 at 1:21pm
Print Post  
The fix is now available in the latest version (21.01.06.11) available from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint