Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
fatal error: asf.h: No such file or directory (Read 2953 times)
rischae
Newbies
*
Offline



Posts: 1
fatal error: asf.h: No such file or directory
Nov 10th, 2017 at 11:27am
 
Hello,

i have a problem with my project (Arduino Due).

I created a project with older versions of Atmel Studio(Atmel Studio 7.xxx) and VM. The ASF (PIO driver) was also included and everything just worked fine.

Yesterday i updated both (AS7 and VM). Now i have the following problem:

Code:
main.c: 31:17: fatal error: asf.h: No such file or directory
   #include <asf.h>
   compilation terminated
Build failed for project 'Steuerung' 



But this file is in the project folder under src/asf.h. When i'm using #include <src/asf.h> nothing will change.

So, i started a new empty project (vm arduino due) and included the ASF for the Due. With the same result... Cry

Can anyone help me?
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10473
United Kingdom
Re: fatal error: asf.h: No such file or directory
Reply #1 - Nov 10th, 2017 at 4:11pm
 
Hi,

Two questions

Is the file actually included in the project/solution tree? Does it have a little red exclamation mark against it?

Does #include "src/asf.h" work?
Back to top
 
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10473
United Kingdom
Re: fatal error: asf.h: No such file or directory
Reply #2 - Dec 19th, 2017 at 12:01am
 
@davidml This is a different question so has been moved here

http://www.visualmicro.com/forums/YaBB.pl?num=1513640310

Back to top
« Last Edit: Dec 19th, 2017 at 12:04am by Visual Micro »  
WWW  
IP Logged
 
davidml
Newbies
*
Offline



Posts: 7
Re: fatal error: asf.h: No such file or directory
Reply #3 - Dec 19th, 2017 at 12:07am
 
Quick update, I was able to recreate this problem and as it turns out it has everything to do with the fact that when I right click the project and choose Add Arduino Library and add my libraries to my project it copies the source code from these libraries into my project under src and include.  This is the error I get when I included the Chronos library. 

Calendar.cpp: 26:42: fatal error: chronosinc/schedule/Calendar.h: No such file or directory
   #include "chronosinc/schedule/Calendar.h"
   compilation terminated

     An error was encountered during the 'Deep Search' library discovery process.
Debug build failed for project 'MyTestProject'

I can eliminate this error by forcing the compiler to include the path to chronosinc/schedule/Calendar.h via the Extra c flags and Extra cpp flags, but I still end up with a link error.  But if I simply delete the directory hierarchies "include" and "src" from my project it compiles and links just fine without adding the Extra c flags and Extra cpp flags. 

So my question now is, am I adding the Arduino libraries to my project incorrectly?  I tried to add them as I usually do via Atmel Studio, right click on the Project -> Libraries and choose Add.  When I add them that way I also manually add the Include directories to Toolchain -> C Compiler and Toolchain -> C++ compiler but that doesn't work with Visual Micro as it overwrites any edits I perform to this setting. 

What is the correct way to add an Arduino library to a Visual Micro Arduino project? 
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print