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 Cannot find library .h files (Read 4406 times)
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Cannot find library .h files
Jul 3rd, 2016 at 7:36pm
Print Post  
I add a library from the user libraries and the .h file gets added to my .ino correctly. I reference the same .h file in a local class but get the error "No such file or directory".

This has happened with Wire.h and HMC5883L.h. Both of these files come from libraries I had to create myself. The Wire library was copied from C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire and the  HMC5883L class was a renaming of the Arduino-HMC5883L-master folder that I downloaded from https://github.com/jarzebski/Arduino-HMC5883L

This problem has been recurring, especially with Wire.h which was (I believe) at one time part of the core distribution. 

So there are two questions here:
1) How do I include wire.h properly? I cannot simply add it from the location in the hardware folder - there is no provision for that in the VM/VS UI.
2) How do I include the HMC5883L library. I don't want to use the Adafruit library because it doesn't seem to work as the one from Jarzebski.

I have attached my build output text and the source code for my project.
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot find library .h files
Reply #1 - Jul 3rd, 2016 at 7:46pm
Print Post  
Hi,

Where have you installed the user libraries (folder path)?

Are the #includes in a .h file?

Thanks
« Last Edit: Jul 3rd, 2016 at 7:47pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Cannot find library .h files
Reply #2 - Jul 4th, 2016 at 12:13am
Print Post  
All libraries are in the Arduino/libraries folder. All files I am including are .h files. The attached screen shot shows the library folders. The attached zip file contains the contents of the folders that contain the .h files I am trying to include.
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot find library .h files
Reply #3 - Jul 4th, 2016 at 12:48am
Print Post  
The problem is that all .ino files are combined into a project_name.cpp in the temp folder so the compiler thinks your CompassHeading.cpp is the code and ignores the .ino files.

There is a planned to change to use project_name.ino.cpp in the temp folder so to avoid this clash.

For now please rename CompassHeading.cpp to something else.
« Last Edit: Jul 4th, 2016 at 12:48am by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint