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 Another compilation problem in VS but not the IDE (Read 3663 times)
Mike.H.
Newbies
*
Offline


Posts: 2
Joined: Apr 22nd, 2016
Another compilation problem in VS but not the IDE
Apr 22nd, 2016 at 7:47am
Print Post  
Hi and thanks for your great plugin. 

Preliminary:
Arduino 1.6.8 installation
VS 2015 Community installation
VMicro plugin

I installed it yesterday and made a small program for my Leonardo. It compiled and everything was fine. However at some point in time suddenly it started to give compiler error messages!

I tried altering my code to find where I made a mistake. I could not find any. After a while I ended up with a blank file and still I got the compilation error.

I then created a new solution from the Blink code template and this solution TOO had the same compilation error.

I did NOT alter any settings in VsMicro. Just to make sure I uninstalled the plugin and reinstalled the plugin. I still got the same error (full trace log is attached as file, here just the error):
Code
Select All
CDC.cpp:In file included from
USBAPI.h:152:16: error: cannot declare variable 'Serial' to be of abstract type 'Serial_
:extern Serial_ Serial
USBAPI.h:because the following virtual functions are pure within 'Serial_
 class Serial_ *:public Stream
Stream.h:In file included from
HardwareSerial.h:from
Arduino.h:from
USBAPI.h:from
CDC.cpp:from
Print.h:write(uint8_t)
:virtual size_t write(uint8_t) = 0
CDC.cpp:193:8: error: prototype for 'size_t Serial_::write(uint8_t)' does not match any in class 'Serial_
 size_t Serial_*:write(uint8_t c)
Stream.h:In file included from
HardwareSerial.h:from
Arduino.h:from
USBAPI.h:from
CDC.cpp:from
Print.h:48:20: error: candidates are: virtual size_t Print::write(uint8_t)
:virtual size_t write(uint8_t) = 0
Print.h:49:12: error:                 size_t Print::write(const char*)
:size_t write(const char *str) {
Print.h:54:12: error:                 size_t Print::write(const char*, size_t)
:size_t write(const char *buffer, size_t size) {
CDC.cpp:In file included from
USBAPI.h:104:17: error:                 virtual size_t Serial_::write(const uint8_t*, size_t)
:virtual size_t write(const uint8_t*, size_t)
CDC.cpp:277:9: error: cannot declare variable 'Serial' to be of abstract type 'Serial_
:Serial_ Serial
CDC.cpp:In file included from
USBAPI.h:note    since type 'Serial_' has pure virtual functions
 class Serial_ *:public Stream
Error compiling core 



Funny thing is, that in my old project I was working with Serial, but the Blink1 code has no references to Serial etc. 

I thought that perhaps I accidentally altered any .h or .cpp files from my Arduino installation. So I compared the original .ZIP content with my extracted files and they were the same...

I tried clean building, deleting the TEMP directories etc. but no avail. In my desperation I tried to switch to another board. I randomly choose the "Arduino Nano w/ ATmega328" and bingo ... it worked! ... suddenly the Blink example compiles again (compile trace is also attached). Switching back to Leonardo caused the problem again. I then tried various boards and many worked and some did not (failed with the same compilation error).

So I guess it might be some precompile variables or definitions!? ...  Anyway, what strikes me is that it WAS working for the Leonardo and I have NO clue why suddenly it stopped (I really did not alter any vMicro settings or anything).

I got it to work again by doing the following:
1) Uninstall the VMicro Plugin
2) Restart the IDE
2) Delete my Arduino Installation
3) Install the VMicro Plugin
4) Restart the IDE
5) Create a new Blink example solution
6) VMicro does NOT ask me where to find the Arduino sources (like normal after first installation). Instead it displays an "Invalid path" error in the Arduino version window. When I open the configuration dialog manually I see that it still looks for the old folder (so some settings survive the uninstallation of the Plugin!? but where!?).
7) Unzip the Arduino Sources into a NEW directory
8) Choose the new directory in the VMicro config
9) Compile ... -> WORKS!

I also see that choosing the new directory VMicro starts parsing the .H files anew ... it did not do this when I kept my old Arduino directory. 

So I guess somewhere there is a cache and the cache somehow got corrupted and this might have caused the compilation error?

I also see that VMicro remembers a lot of things between installs ... like all the checkbox settings in the VMicro Menu, Arduino files location, etc ... why is this kept even after the plugin is uninstalled. And where is it kept?

Well it works for now ... I will make sure to keep you up to date. I just wanted to know if anyone has an idea what happened here.

Thanks and kind regards,
Mike
  

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Another compilation problem in VS but not the IDE
Reply #1 - Apr 22nd, 2016 at 11:49am
Print Post  
Hi,

If you switch the tool bar from "Debug/Local windows debugger" to "Release" then the Serial debugger will not attempt to work.

I will look into why the Leonardo has a debug problem with Serial but it sounds like you don't need it anyway

The visual micro options are stored in the windows registry. It doesn't matter that they are not entirely cleared and will cause not harm. You will never need to reinstall a working system. People often switch from Atmel to Visual Studio, in this case settings are preserved to allow this.
« Last Edit: Apr 22nd, 2016 at 12:00pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Mike.H.
Newbies
*
Offline


Posts: 2
Joined: Apr 22nd, 2016
Re: Another compilation problem in VS but not the IDE
Reply #2 - Apr 22nd, 2016 at 12:23pm
Print Post  
Actually changing from Debug to Release did not change anything about the compilation error. That was one of the first things I tried (sorry I did not mention it in my initial post).

Also after the steps I took to get it working again (mentioned at the bottom of my post above), it is now working with Debug configuration just fine and I can set breakpoints etc. 

Very strange and I hope it keeps working now Smiley I just wanted to report in case other ppl. stumble on something similar.

Thanks for your time!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Another compilation problem in VS but not the IDE
Reply #3 - Apr 22nd, 2016 at 12:42pm
Print Post  
Sorry I missed that. Thanks, I will look at it some more over the weekend.

I don't think it is related but maybe useful to know... Clicking "Build>Clean Solution" clears the temp build cache for the current project.

Did you use the same project for each of your tests?
« Last Edit: Apr 22nd, 2016 at 12:43pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint