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) Clean install - Intellisense (and other) errors Teensy (Read 3799 times)
AdiGital
Newbies
*
Offline


Posts: 7
Joined: Feb 3rd, 2020
Clean install - Intellisense (and other) errors Teensy
Feb 4th, 2020 at 3:21pm
Print Post  
I suddenly started experiencing various problems with my project (like "PCH warning: header stop cannot be in a linkage block", compile errors etc). I tried various methods of troubleshooting. It would show fine and compile in Arduino but show errors or not compile in VS/VM. I narrowed it down to the fact that the problems began after I included Audio library for Teensy 3.2. Because some of it could be caused by my code or lack of knowledge I decided to start from scratch. Clean Windows install, clean default VS, Arduiono, TeensyDuino and then Visual Micro. All with default settings.

To replicate the issue first thing I tried is to open the included example via Micro Explorer:
Teensy -> Audio -> SamplePlayer

The example compiles (now) but it's full of Intellisense errors (30).
  

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Clean install - Intellisense (and other) errors Teensy
Reply #1 - Feb 4th, 2020 at 4:41pm
Print Post  
That output shows compile OK. Can you provide an output of a failed compile before we look at intellisense issues. The two things, compile and intellisense are unrelated.
  
Back to top
IP Logged
 
AdiGital
Newbies
*
Offline


Posts: 7
Joined: Feb 3rd, 2020
Re: Clean install - Intellisense (and other) errors Teensy
Reply #2 - Feb 4th, 2020 at 4:49pm
Print Post  
I did another cleanup and the code does compile now. It must have been me trying out all sorts of things and switches. Most likely I broke something. This here is the direct result of just running the sketch after clean install without changing a single character in the code nor in settings. Without fixing the intellisense in this example there is no point me even trying my sketch as the use of Audio library is essential.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Clean install - Intellisense (and other) errors Teensy
Reply #3 - Feb 4th, 2020 at 5:02pm
Print Post  
Okay. To be clear, you are saying that the compile upload works fine with the audio library but now we have to find a solution to intellisense problems?
  
Back to top
IP Logged
 
AdiGital
Newbies
*
Offline


Posts: 7
Joined: Feb 3rd, 2020
Re: Clean install - Intellisense (and other) errors Teensy
Reply #4 - Feb 4th, 2020 at 5:11pm
Print Post  
Yes, that's correct. As I mentioned, the problems started appearing once I included the Audio library in my code. Assuming some of it (my code) might be not entirely error free or messed up, I tested just the example on a very clean install. Intellisense shows errors on objects from the Audio lib. It finds the definitions with F12 and the error disappears until next rebuild.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Clean install - Intellisense (and other) errors Teensy
Reply #5 - Feb 4th, 2020 at 5:15pm
Print Post  
We can look at the intellisense but Visual Studio can be a bit erratic in this area when it hits certain code syntax that it does not understand. It always amazes me that F12 or opening a code file resolves the issue. It is possible to add some intellisense overrides within #if conditions that are not compiled. That might be a solution, we will see.

This is one area where atmel studio wins because if the intellisense hits something it doesn't understand it just ignores it.
« Last Edit: Feb 4th, 2020 at 5:16pm by Tim@Visual Micro »  
Back to top
IP Logged
 
AdiGital
Newbies
*
Offline


Posts: 7
Joined: Feb 3rd, 2020
Re: Clean install - Intellisense (and other) errors Teensy
Reply #6 - Feb 4th, 2020 at 5:36pm
Print Post  
I replicated the initial PCH warning problem:
Created: empty Arduino project
Added: .h & .cpp class
Added: #include <Audio.h> in the ino file and the line 
#include "SomeClass.h"
in .cpp file gets squiggly line at the end and the next line with error (included screenshot):
PCH warning: header stop cannot be in a linkage block.  An IntelliSense PCH file was not generated.
Excluding Audio removes the error.
The code compiles though.
  

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Clean install - Intellisense (and other) errors Teensy
Reply #7 - Feb 4th, 2020 at 11:28pm
Print Post  
Thanks very much for this report. The latest Teensyduino 1.5 required some minor intellisense changes. There is a new release of visual micro 2001.3.1 with the changes here. It might require a build for the new intellisense changes to be detected but you should not see the PCH error.

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
  
Back to top
IP Logged
 
AdiGital
Newbies
*
Offline


Posts: 7
Joined: Feb 3rd, 2020
Re: Clean install - Intellisense (and other) errors Teensy
Reply #8 - Feb 5th, 2020 at 8:23am
Print Post  
Thank you very much!
I'll clean up my (multi target) project today and see how it behaves.
  
Back to top
 
IP Logged
 
AdiGital
Newbies
*
Offline


Posts: 7
Joined: Feb 3rd, 2020
Re: Clean install - Intellisense (and other) errors Teensy
Reply #9 - Feb 5th, 2020 at 1:01pm
Print Post  
So far so good. The part based on Teensy target works fine. The Intellisense problems seem to be gone except one instance:
The macro in Audio library:

#define AudioMemory(num) ({ \
     static DMAMEM audio_block_t data[num]; \
     AudioStream::initialize_memory(data, num); \
})

isn't "understood" by intellisense. For now I replaced the line with the macro's content.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Clean install - Intellisense (and other) errors Teensy
Reply #10 - Feb 5th, 2020 at 3:42pm
Print Post  
Great, yes I saw that. What did you redefine it as we can try to add it to the default intellisense overrides.
  
Back to top
IP Logged
 
AdiGital
Newbies
*
Offline


Posts: 7
Joined: Feb 3rd, 2020
Re: Clean install - Intellisense (and other) errors Teensy
Reply #11 - Feb 5th, 2020 at 4:02pm
Print Post  
As it's only used once in the initialisation, I just replaced the macro:

AudioMemory(10);
with
static DMAMEM audio_block_t data[10];
AudioStream::initialize_memory(data, 10);


It was the easiest thing to do in my case.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Clean install - Intellisense (and other) errors Teensy
Reply #12 - Feb 5th, 2020 at 10:28pm
Print Post  
Ah yes I forgot that I looked at that but because a library includes the code the visual micro intellisense vsarduino.h comes in too early. The #includes for the library are actually in your code so you need to redefine from an appropriate location.

I think simplest solution, is to you have one .h with all your redefines if you come across more library related issues, then add an #include to your .h where needed. Maybe this is what you have done anyway.

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint