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 Compiling error, cannot find specified library. (Read 4815 times)
Ender06
Newbies
*
Offline


Posts: 3
Joined: Jan 5th, 2018
Compiling error, cannot find specified library.
Jan 5th, 2018 at 9:21pm
Print Post  
Hi, so I'm at my wits end here, I have a pretty extensive project which I've been working on for a while and everything was going alright until I installed a couple of extra libraries for a different project. Now my main project won't compile...  It seems to revolve around a particular library here:  https://github.com/NicoHood/MSGEQ7

When I try to compile I get this error:  

Quote:
MSGEQ7.h: 110:22: fatal error: MSGEQ7.hpp: No such file or directory
   #include "MSGEQ7.hpp"
   compilation terminated


     An error was encountered during the 'Deep Search' library discovery process.
Build failed for project 'M0_V6.0_Test'



I went through visual micro's library installer to install the library: downloading a fresh .zip file from the library's github and having vmicro install it via the "Install Arduino Library from Zip", and I hit rescan tool chain as good measure.  And it seemed to install fine, however it doesn't seem to show up in green in the Visual Micro Explorer as can be seen here:  https://imgur.com/a/O8CWj

Intellisense sees it, as I am able to use the in line menus to navigate to it when I do a #include (And I've even tried using that to compile with, with no success).  And I can even open the MSGEQ7.h and MSGEQ7.hpp file by right clicking on them in the Visual stuido's document window and clicking on "Open document"!  

I've attempted multiple ways of pointing the #include instruction to the file such as:

#include <MSGEQ7.h>
vs
(Letting intellisense navigate to it)
#include <MSGEQ7\src\MSGEQ7.h>

Visual Micro and the arduino program are not pointing to the default folder in "MyDocuments" but to a arduino specific folder in dropbox as I work on projects between computers.  Both computers that I work on no longer compile...  I've updated the Arduino IDE to 1.8.5 and grabbed a fresh copy of Visual Micro just in case, but no success yet. 


Any help would be greatly appreciated!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling error, cannot find specified library.
Reply #1 - Jan 5th, 2018 at 10:21pm
Print Post  
Hi,

You should only use this syntax to include libs

#include <MSGEQ7.h>

When you install a library all that happens is that it is unpacked into your "documents/arduinolibraries" or in your case a sub folder called \libraries below whatever your arduino dropbox sketchbook folder is set to be.

You can delete or move all the libraries and then reinstall if in doubt. After changing libraries outside of the ide click "vmicro>genral>rescan toochains" or restart the ide.

The library resolution process can be confused by libraries that use includes with the same name. 

A good riles is as follows

1) If a library has a header that shares the same name as the library folder then #include it early in your code so that library gets priority when resolving other duplicate files names

\Lib1\Lib1.h
\Lib1\Test.h
\Lib2\Lib2.h
\Lib2\Test.h

In the above example #include Test1.h early in the code #includes can cause confusion. #include <Lib1.h> before "Test.h" will ensure the compiler selects the Lib1 library

You can add empty .h files to lib folders if they do not contain a .h of the same name.

Hope this helps.

fyi: Visual Micro does allow you to use arduino libraries via "shared projects" which allows you to specify a library location avoiding the arduino duplicate name issues.

  
Back to top
WWW  
IP Logged
 
Ender06
Newbies
*
Offline


Posts: 3
Joined: Jan 5th, 2018
Re: Compiling error, cannot find specified library.
Reply #2 - Jan 5th, 2018 at 11:07pm
Print Post  
Quote:
You should only use this syntax to include libs

#include <MSGEQ7.h>


I understand this, but the problem I have is when I attempt to use this this is what happens: 
 
https://imgur.com/a/ZbjfY

As you can see from the screenshots, Intellisense doesn't see the .h file alone, it HAS to go into the file tree to find it...  Unlike the other libraries (they pop up as "libraryname.h" just fine).

Regarding your other points, I have tried to uninstall and re-install each library on its own.  Intellisense even sees them as I individually add each back to the "dropbox/arduino/libraries" folder on its own (the little red squiggly disappears on each one I add back in, even the MSGEQ7), as you can see from the screenshots the library in question is also at the very beginning of the code.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling error, cannot find specified library.
Reply #3 - Jan 6th, 2018 at 8:05pm
Print Post  
Intellisense is less accurate so should be ignored.

Please look for a library.properties text file in the library folder where MSGEQ7.h exists.

What is in the architectures= property?


also switch on vmicro?compiler>verbose and "show build properties". then build and email the output as a .txt file to info[at]visualmicro.com. include a link to this thread in the email

Thanks

« Last Edit: Jan 6th, 2018 at 8:07pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Ender06
Newbies
*
Offline


Posts: 3
Joined: Jan 5th, 2018
Re: Compiling error, cannot find specified library.
Reply #4 - Jan 7th, 2018 at 6:20pm
Print Post  
Ok so I was able to get it working after some futzing around!  

It appears the main problem I had was that arduino IDE itself had reset it's main directory (maybe after an update?  Maybe I forgot to actually re-direct it entirely?)  So I changed it to my dropbox folder, did some testing and it worked!

A secondary problem though was that I wanted to be able to use Visual Studio/Micro on my laptop as well as my desktop, I basically had identical setups on both (software wise), but my laptop's VS/M still refused to compile.  Per your recommendation, I checked the "architectures=" line of the library.properties file and compared the MSGEQ7's file to other libraries that would work.  

MSGEQ7's architecture's property said "avr" while the other libraries were either "samd" or "*" (usually "*")  So I changed the line to "*" and it works!  (I believe the reason MSGEQ7's library had the "avr" is supposedly the library was written to only work with atmega? but I've been using a M0 for most of my projects involving this library for the extra horsepower, and its been working fine) 
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling error, cannot find specified library.
Reply #5 - Jan 8th, 2018 at 11:27pm
Print Post  
Hi,

Thanks for the info.

One job for me is that architecures are correctly used when showing you valid libraries in the "add library" menus but when the compile happens the architecture should be ignored if it is wrong. Some architectures have been created with incorrect values. * means any which is what the MSGEQ7.h should use but does not.

I will add to the next release.

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling error, cannot find specified library.
Reply #6 - Jan 27th, 2018 at 11:52pm
Print Post  
Resolved in the next release due over the next couple of days.

Thanks for the report.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint