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) vMicro failing to compile any sketch for Uno R4 Wifi board? (Read 2025 times)
Locklins
Newbies
*
Offline


Posts: 6
Joined: Nov 19th, 2023
vMicro failing to compile any sketch for Uno R4 Wifi board?
Nov 20th, 2023 at 5:49pm
Print Post  
I'm running into a weird compilation error that my google-fu can't solve.

Whenever I try to compile any project with the Uno R4 Wifi board, I get this error(full output txt attached):

Code (C++)
Select All
String.cpp: 127:39: error: 'FLT_MAX_10_EXP' was not declared in this scope
   static size_t const FLOAT_BUF_SIZE = FLT_MAX_10_EXP + FLT_MAX_DECIMAL_PLACES + 1 \* - *\ + 1 \* . *\ + 1 \* \0 *
   ^~~~~~~~~~~~~~
String.cpp:127: note  suggested alternative  __FLT_MAX_10_EXP__
   static size_t const FLOAT_BUF_SIZE = FLT_MAX_10_EXP + FLT_MAX_DECIMAL_PLACES + 1 \* - *\ + 1 \* . *\ + 1 \* \0 *
   ^~~~~~~~~~~~~~
   __FLT_MAX_10_EXP__

String.cpp: 129:25: error: size of array 'buf' is not an integral constant-expression
   char buf[FLOAT_BUF_SIZE]
String.cpp: In constructor arduino::String::String(double, unsigned char)

String.cpp: 136:40: error: 'DBL_MAX_10_EXP' was not declared in this scope
   static size_t const DOUBLE_BUF_SIZE = DBL_MAX_10_EXP + DBL_MAX_DECIMAL_PLACES + 1 \* - *\ + 1 \* . *\ + 1 \* \0 *
   ^~~~~~~~~~~~~~
String.cpp:136: note  suggested alternative  __DBL_MAX_10_EXP__
Error compiling core
Build failed for project 'UnoR4_Sandbox'
   static size_t const DOUBLE_BUF_SIZE = DBL_MAX_10_EXP + DBL_MAX_DECIMAL_PLACES + 1 \* - *\ + 1 \* . *\ + 1 \* \0 *
   ^~~~~~~~~~~~~~
   __DBL_MAX_10_EXP__ 



and a couple more errors from the same String.cpp file.

However if I switch to the Ardiuno Uno(R3) board, everything compiles without issue. Also to note, the project I'm compiling in the attached output is just a blank arduino project from the project wizard.

In case anyone asks, everything compiles without issue using the Arduino IDE 2. I've also attached full compile output from Arduino IDE 2.

Thanks in advance for any help.
  

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


Posts: 6
Joined: Nov 19th, 2023
Re: vMicro failing to compile any sketch for Uno R4 Wifi board?
Reply #1 - Nov 20th, 2023 at 5:51pm
Print Post  
[Edit: I've also attached the String.cpp and String.h files that are giving me the error. The "FLT_MAX_10_EXP" defines themselves seem to be in the <float.h> header file:

Code (C++)
Select All
#define FLT_MAX_10_EXP   38                      // max decimal exponent
#define LDBL_MAX_10_EXP  DBL_MAX_10_EXP          // max decimal exponent 



  

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


Posts: 2441
Joined: Feb 13th, 2019
Re: vMicro failing to compile any sketch for Uno R4 Wifi board?
Reply #2 - Nov 21st, 2023 at 12:16pm
Print Post  
Thanks for the updates.

Can you restart the Arduino IDE, or delete the cached core folder, so that it is forced to build the core again so we can see the full output of this part of the process?
  
Back to top
IP Logged
 
Locklins
Newbies
*
Offline


Posts: 6
Joined: Nov 19th, 2023
Re: vMicro failing to compile any sketch for Uno R4 Wifi board?
Reply #3 - Nov 21st, 2023 at 4:56pm
Print Post  
[Accidentally deleted last post]
Here it is:

Sorry for the formatting, word wrap is making these output files ugly to read in the browser. :/
« Last Edit: Nov 21st, 2023 at 5:03pm by Locklins »  

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


Posts: 2441
Joined: Feb 13th, 2019
Re: vMicro failing to compile any sketch for Uno R4 Wifi board?
Reply #4 - Nov 21st, 2023 at 6:27pm
Print Post  
Thanks for the logs.

Can you try adding a local board.txt file to your project (vMicro > Add Code > Add Local Board.txt) and paste in the contents of the attached file.

Then if you run Build > Clean Solution in Visual Studio, and try recompiling, it should compile exactly as the Arduino IDE is currently.
  

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


Posts: 6
Joined: Nov 19th, 2023
Re: vMicro failing to compile any sketch for Uno R4 Wifi board?
Reply #5 - Nov 22nd, 2023 at 5:25pm
Print Post  
[EDIT: I even tried making any entirely new arduino project from the project wizard, and then added the local boards txt file and compiled, but still had the same problem.]

Still stopping on the same error.
Here's a link to the build output with the local boards txt(the board won't allow me to add anymore attachments for some reason):

https://gist.github.com/LocklinRhys/878b999ff2452262231adec208f0a3ee

This is weird :/

Thanks for your time!
« Last Edit: Nov 22nd, 2023 at 5:59pm by Locklins »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: vMicro failing to compile any sketch for Uno R4 Wifi board?
Reply #6 - Nov 22nd, 2023 at 7:57pm
Print Post  
For adding attachments, you may need to update your session, which will be shown in the toolbar at the top of the forum with an "Update Session" button if it is needed.

I agree it is very odd, and can't currently understand why the error is showing in vMicro and not in the Arduino IDE, especially with the same command (though the difference of removing the -w flag should have no effect as it just supresses warnings).

Can you try....
1) Closing all Arduino IDE and VS instances (and anything with any of the String.cpp/.h or float.h files open in it)
2) Open VS, and use File > Open Arduino Project, and open the same INO you are using in the Arduino IDE
NOTE - Don't add in the Local board.txt entries to this project as they made no difference and should not be required
3) Run build > clean Solution (just to be sure the shared core cache is clear)
4) Run the build process...

If this doesn't work then you could try running the command for the String.cpp via the command line after the above..... just to check that it works as expected, though it should give the same error.
  
Back to top
IP Logged
 
Locklins
Newbies
*
Offline


Posts: 6
Joined: Nov 19th, 2023
Re: vMicro failing to compile any sketch for Uno R4 Wifi board?
Reply #7 - Nov 23rd, 2023 at 10:28pm
Print Post  
Yeah, same problem still. Sad

I think it may have something to do with my VS2022 installation, but I'm not sure why. I'll continue to play around with it and see if I can get something to change.

But about this:

Quote:
If this doesn't work then you could try running the command for the String.cpp via the command line after the above..... just to check that it works as expected, though it should give the same error.


What command for the String.cpp file do you mean? I'm confused.
  
Back to top
 
IP Logged
 
Locklins
Newbies
*
Offline


Posts: 6
Joined: Nov 19th, 2023
Re: vMicro failing to compile any sketch for Uno R4 Wifi board?
Reply #8 - Nov 24th, 2023 at 12:32am
Print Post  
Okay, I solved the problem!

Only I have no idea why exactly this solved problem, and I'm posing this info here incase you might.

After repairing my VS2022 install failed to fix the problem, I noticed I had installed some Intel C++ compiler (IntelĀ® oneAPI DPC++/C++ Compiler to be exact) to play with and forgot about.

After uninstalling that compiler and repairing V2022, problem solved!

I'm not smart enough nor experienced enough to understand what was going wrong, but you probably are, so I'm attaching the successful build output to this post in the chance it might help you in any future development.

Thanks for your help! Let me know if you'd like any more info.
« Last Edit: Nov 24th, 2023 at 12:35am by Locklins »  

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


Posts: 2441
Joined: Feb 13th, 2019
Re: vMicro failing to compile any sketch for Uno R4 Wifi board?
Reply #9 - Nov 24th, 2023 at 9:35am
Print Post  
Thanks for the update, and for the excellent detail on the solution here, as well as persevering!

We will investigate this and see if we can prevent this from happening in this scenario, or add the relevant documentation to help others avoid this.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint