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
Hot Topic (More than 8 Replies) error: expected nested-name-specifier... with using statement (Read 3689 times)
TonyZ
Junior Member
**
Offline


Posts: 13
Joined: Jun 6th, 2023
error: expected nested-name-specifier... with using statement
Feb 29th, 2024 at 11:45pm
Print Post  
When there are multiple lines of using statements, the code would not compile with the error message:
Code
Select All
usingtest.ino: 14:7: error: expected nested-name-specifier before 'void
   void setup() {
   ^~~~
 



This error could be re-created with the following code:
Code (C++)
Select All
#include <vector>
#include <array>

using HashData = std::array<uint8_t, 32>;
using PublicKey = std::array<uint8_t, 32>;

// the setup function runs once when you press reset or power the board
void setup() {

}

// the loop function runs over and over again until power down or reset
void loop() {

}
 

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2767
Joined: Feb 13th, 2019
Re: error: expected nested-name-specifier... with using statement
Reply #1 - Mar 1st, 2024 at 3:21pm
Print Post  
Thanks for the report, we are investigating this and will update this thread when the fix is available.

To work around the issue for now, if you add a variable declaration between the last using statement and the setup() function, it should compile as expected:

Code
Select All
#include <vector>
#include <array>

using HashData = std::array<uint8_t, 32>;
using PublicKey = std::array<uint8_t, 32>;

int pointlessVar = 0;

// the setup function runs once when you press reset or power the board
void setup() {

}

// the loop function runs over and over again until power down or reset
void loop() {

} 

  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2767
Joined: Feb 13th, 2019
Re: error: expected nested-name-specifier... with using statement
Reply #2 - Mar 13th, 2024 at 4:43pm
Print Post  
Can you try installing the latest release (24.0313.00) from the top of the board below, this should resolve the issue seen with these prototypes:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
  
Back to top
IP Logged
 
TonyZ
Junior Member
**
Offline


Posts: 13
Joined: Jun 6th, 2023
Re: error: expected nested-name-specifier... with using statement
Reply #3 - May 13th, 2024 at 12:36am
Print Post  
Good to know. However, this update cannot be found through "Extensions > Manage Extensions > Updates" in Visual Studio.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2767
Joined: Feb 13th, 2019
Re: error: expected nested-name-specifier... with using statement
Reply #4 - May 13th, 2024 at 4:30pm
Print Post  
It is correct the VS2017/2019 version can no longer be found via the Extension Manager in Visual Studio, it can be downloaded from the forum or our downloads page on the website.

Let us know if you have any issues installing the new version, and if this resolves the issue.
  
Back to top
IP Logged
 
TonyZ
Junior Member
**
Offline


Posts: 13
Joined: Jun 6th, 2023
Re: error: expected nested-name-specifier... with using statement
Reply #5 - May 13th, 2024 at 4:31pm
Print Post  
But I am using VS2022, so I should be able to see it in the Extension Manager, right?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2767
Joined: Feb 13th, 2019
Re: error: expected nested-name-specifier... with using statement
Reply #6 - May 13th, 2024 at 4:37pm
Print Post  
Apologies, yes it will show in the Extension Manager when the version is updated on the Microsoft Site.

In the meantime it can be downloaded form the forum board below and manually installed:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

  
Back to top
IP Logged
 
TonyZ
Junior Member
**
Offline


Posts: 13
Joined: Jun 6th, 2023
Re: error: expected nested-name-specifier... with using statement
Reply #7 - May 13th, 2024 at 4:38pm
Print Post  
Thanks. How long would the delay be between the release on the website and the release through Extension Manager?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2767
Joined: Feb 13th, 2019
Re: error: expected nested-name-specifier... with using statement
Reply #8 - May 13th, 2024 at 4:59pm
Print Post  
There is no specific timescale between it being available in the forum as a beta, and being finally released to Microsoft.

We will be releasing the latest version shortly to the Microsoft Gallery, so it will show in extension manager.

The file downloaded from our website/forum is exactly the same package, and does not affect future updates or anything else differently to the one from the Microsoft Gallery.
  
Back to top
IP Logged
 
TonyZ
Junior Member
**
Offline


Posts: 13
Joined: Jun 6th, 2023
Re: error: expected nested-name-specifier... with using statement
Reply #9 - May 13th, 2024 at 5:00pm
Print Post  
Good to know. Thanks.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2767
Joined: Feb 13th, 2019
Re: error: expected nested-name-specifier... with using statement
Reply #10 - May 14th, 2024 at 7:41am
Print Post  
The release is now available through Extension Manager in Visual Studio (24.0510.00) as well as on the forum.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint