Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Strange error during building phase in Visual Studio (Read 112 times)
AddyK
Newbies
*
Offline



Posts: 4
Strange error during building phase in Visual Studio
Oct 9th, 2020 at 3:35pm
 
Since the last update (using now latest version VS and VM) I get a strange error during the final building phase of my project not seen before. It gives the following errors:

----------------------------------
Garden.ino: 98:44: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
   unsigned int minutes = (((((unsigned long)( PickTime )- milliseconds) \ 1000) - seconds) \ 60) % 60

Garden.ino: 98:1: error: stray '\' in program
   unsigned int minutes = (((((unsigned long)( PickTime )- milliseconds) \ 1000) - seconds) \ 60) % 60

Garden.ino: 98:1: error: stray '\' in program

Garden.ino: 98:34: error: request for member 'iram' in '"\\"', which is of non-class type 'const char [2]
   unsigned int minutes = (((((unsigned long)( PickTime )- milliseconds) \ 1000) - seconds) \ 60) % 60

Garden.ino: 98:44: error: expected unqualified-id before string constant
   unsigned int minutes = (((((unsigned long)( PickTime )- milliseconds) \ 1000) - seconds) \ 60) % 60

Garden.ino: 98:89: error: section attribute not allowed for 'void osWatch()
   unsigned int minutes = (((((unsigned long)( PickTime )- milliseconds) \ 1000) - seconds) \ 60) % 60

------------------------------

VS/VM compiles the project code without any error. Also there are no error indicated in the editor.
If I use Arduino it compiles correctly and builds the bin file.

Strange is:

Garden.ino: 98:44: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]

because it make no sense at all looking to the code..
So I was wondering if someone experienced the same problem and has a solution for it..
Thanks!
Back to top
 
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 510
Re: Strange error during building phase in Visual Studio
Reply #1 - Oct 9th, 2020 at 3:45pm
 
Thanks for the report.  To help us investigate, can you attach a full build log, with the Verbose and Show Build Properties options set as shown in the box at the top of this page?
Back to top
 
 
IP Logged
 
AddyK
Newbies
*
Offline



Posts: 4
Re: Strange error during building phase in Visual Studio
Reply #2 - Oct 9th, 2020 at 4:14pm
 
Hi Simon. I attached the log. Let me know if you need more information..

Thanks for looking into it..

Addy
Back to top
 

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



Posts: 510
Re: Strange error during building phase in Visual Studio
Reply #3 - Oct 9th, 2020 at 4:36pm
 
Thanks for the logging, and the line it seems to dislike most is below...
Code:
unsigned int minutes = (((((unsigned long)( PickTime )- milliseconds) \ 1000) - seconds) \ 60) % 60 



Should the '\' not be '/'?
Code:
unsigned int minutes = (((((unsigned long)( PickTime )- milliseconds) / 1000) - seconds) / 60) % 60 

Back to top
 
 
IP Logged
 
AddyK
Newbies
*
Offline



Posts: 4
Re: Strange error during building phase in Visual Studio
Reply #4 - Oct 9th, 2020 at 6:01pm
 
The strange thing is that the original code is as follows (lines 95..99):

Code:
	unsigned long PickTime = millis();
	unsigned long milliseconds = (unsigned long)( PickTime ) % 1000;
	unsigned int seconds = (((unsigned long)( PickTime )- milliseconds) / 1000) % 60;
	unsigned int minutes = (((((unsigned long)( PickTime )- milliseconds) / 1000) - seconds) / 60) % 60;
	unsigned int hours = ((((((unsigned long)( PickTime )- milliseconds) / 1000) - seconds) / 60) - minutes) / 60; 



So there the slashes are in the right direction (i think)...
Back to top
 
 
IP Logged
 
AddyK
Newbies
*
Offline



Posts: 4
Re: Strange error during building phase in Visual Studio
Reply #5 - Oct 15th, 2020 at 6:31pm
 
By installing the latest release of Visual Micro the problem was solved.
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print