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 Compiler difference with "Show all sources enabled" (Read 2292 times)
garrison
Junior Member
**
Offline


Posts: 28
Joined: Mar 27th, 2015
Compiler difference with "Show all sources enabled"
Jan 3rd, 2016 at 5:50pm
Print Post  
And now I've got another issue  Smiley

The option "Show arduino core and library sources" seems very useful - it shows my custom libraries and I have quick access to them. The problem is found when I compile a project. One of my custom libraries (RTC module class) uses Arduino Wire.h library for data exchange. And even if my this custom library is not used in .ino file - the compiler throws an error forcing me to include "Wire.h" to the .ino file (so, if I do this, compilation goes fine). On the other hand if I click "Show arduino core and library sources" again to hide libraries files in Solution Explorer tab - the compilation is successfull too even without including "Wire.h" to .ino file.

Is there a solution for this or I'm understanding or doing smth wrong?
« Last Edit: Jan 3rd, 2016 at 7:29pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiler difference with "Show all sources enabled"
Reply #1 - Jan 3rd, 2016 at 7:32pm
Print Post  
Hi,

It's been normal for many years that if a library uses another library it must also be #included near the top of the main .ino file.

In Arduino 1.6.6 (past month) they started to provide a way to automatically discover these includes. It's not implement in Visual Micro yet because the system is too slow for intellisense to use it. We will shortly have a new system that is a combination of solutions but for now you have to do it the way things have always been done.

I have no idea why you would get a different behavior with "show all files enabled". I would expect this to be the case in all build instances.
  
Back to top
IP Logged
 
garrison
Junior Member
**
Offline


Posts: 28
Joined: Mar 27th, 2015
Re: Compiler difference with "Show all sources enabled"
Reply #2 - Jan 3rd, 2016 at 8:01pm
Print Post  
Yes, I remember that I need to #include library (lib1, for example) into main .ino file, if it is used in another library (lib2). This applies to the library lib2, that is used in the main .ino file, as I understand. So I will need to #include lib2 as well as lib1. But in my case none of lib1 and lib2 is being used in the main .ino file, and the compiler asks me to #include lib1. That is the question. If I click again to "Show arduino core and library sources", then files are hidden in Solution Explorer tree and the compilation succeeds.

As far as I understand, it happens, because all files in "_libraries" section are being compiled regardless if they are used in the .ino file. 

But the way, I use v2 library format, as we discussed in this topic. I have a set of my custom libraries (GPin, GLED and so on) stored in one folder (GLibs), which is placed in Libraries folder. That is why (I think) VM shows all of them in Solution Explorer tree in "_libraries" section when I click "Show arduino core and library sources", even if they are not used in the main .ino file.
« Last Edit: Jan 3rd, 2016 at 8:14pm by garrison »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint