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 Source code line numbers show on compile errors. (Read 1377 times)
Fred99
Newbies
*
Offline


Posts: 4
Joined: Sep 3rd, 2019
Source code line numbers show on compile errors.
Dec 26th, 2019 at 7:32pm
Print Post  
Hi, earlier in the week I installed VS2019 + vMicro extension for a test drive (W10 system).   Thought I might want to move from Atmel Studio 7 to VS2019.

I was able to display, edit and compile .ino files.  I noticed two issues and would appreciate your advice.

1.  compile error messages (bottom window) show source code line numbers, which do not correspond to the line numbers in the editor window.  Please let me know if I need to update a VS configuration menu, to have them match.

2.  Intellsense doesn't recognize uint32_t notation.  (The compiler doesn't complain about this notation.)  Is there a way to update a definitions file to have intellsense recognize this notation?  I know I could substitute 'unsigned long' but I like the other notation because it reminds me how many bits I've allocated for a variable. Intellsense does recognize uint16_, uint8_t.

Thanks.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Source code line numbers show on compile errors.
Reply #1 - Dec 26th, 2019 at 8:04pm
Print Post  
1)
Do the error line numbers that are wrong relate to lines above or below the first line of code in your sketch? The "first line of code" means real code not # includes or defines.

2)
Please follow the guide in yellow above.
  
Back to top
WWW  
IP Logged
 
Fred99
Newbies
*
Offline


Posts: 4
Joined: Sep 3rd, 2019
Re: Source code line numbers show on compile errors.
Reply #2 - Dec 27th, 2019 at 12:12am
Print Post  
Hi, Regarding item one.  I've attached a file with compiler output + error message (verbose mode).  It has abstracted source code at bottom, showing sections involving the error.

This code compiles without error in the arduino IDE.

I thought the error with wrong line number might be specific to this type of error.  So, I rewrote the code, making the c++ structure a global variable, no longer passing the object to the function.   This eliminated the error.

I then created a few simple syntax errors in the code.  These produced errors, with the CORRECT line numbers.  So, I think the original error is an oddball (or a coding error) and may not be worth chasing down.  I have a couple of good workarounds.

I appreciate your quick response to my first post.
Thanks again.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Source code line numbers show on compile errors.
Reply #3 - Dec 27th, 2019 at 10:37am
Print Post  
I suspect the original issue was that user defined types need to be in .h file or you need to manually add prototypes between the user type and the first method that uses the type as an argument.

You can always add your own c++ prototypes into the .ino code. The routine that automatically adds them in the background during compile is not as accurate as you can be.

The arduino ide has improved this over the past couple years but it isn't a 100% solution and I think they are working on something better. Then we will revisit. Until then adding prototypes yourself also makes the code transportable to cpp in the future.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint