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 Errors compiling in Atmel (most of errors because of SPI.h) (Read 1413 times)
MOG_1991
Newbies
*
Offline


Posts: 4
Joined: Feb 7th, 2020
Errors compiling in Atmel (most of errors because of SPI.h)
Feb 7th, 2020 at 7:49pm
Print Post  
Hi, I have tried to compile an Arduino (that works well in Arduino IDE) on Atmel 7.0, but i receive a lot of errors. It is as if Atmel was unable to read my SPI.c and SPI.h files...

Thanks !
  

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


Posts: 12136
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Errors compiling in Atmel (most of errors because of SPI.h)
Reply #1 - Feb 7th, 2020 at 8:25pm
Print Post  
Thanks for the output. In the Arduino IDE please click File>Preferences and confirm what the sketchbook location (folder) is set to? or is it empty?
  
Back to top
IP Logged
 
MOG_1991
Newbies
*
Offline


Posts: 4
Joined: Feb 7th, 2020
Re: Errors compiling in Atmel (most of errors because of SPI.h)
Reply #2 - Feb 7th, 2020 at 9:38pm
Print Post  
Hi. No it is not empty it is : C:\Users\mogagne\sketchbook
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12136
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Errors compiling in Atmel (most of errors because of SPI.h)
Reply #3 - Feb 8th, 2020 at 1:12pm
Print Post  
Thanks for all the info.

1)

In the background both arduino ide and visual micro try to make up for missing c=+ syntax in the .ino code. Visual Micro isn't doing this so well but you can resolve yourself in a better way...

The TimerCallbackSynchro method is defined after it is first used in the setup(). Therefore you should define a prototype for TimerCallbackSynchro() before the setup(). Add the following code to your .ino somewhere before the setup() method.

Code (C++)
Select All
void TimerCallbackSynchro(); 



Adding your own prototypes will make the code transportable from .ino to c++ in the future so it's a good thing to do anyway. The arduino ide will detect you have added a prototype of your own and will not try to add a duplicate.

You can force visual micro to create prototypes in background by setting "Generate Prototypes=True" in the Project Properties, but I recommend you always add them yourself because then it will be an exact science.

2)

Another issue is that Visual Micro is allowing your own code to override the core. The core you are using has a Uart.h but your local project also has a Uart.h

I renamed the Uart.h in your project to UartLocal.h and then altered the #include "Uart.h" in the "Uart.cpp", the ".ino" and the "AquisitionManager.cpp" to #include "UartLocal.h

Summary

The above should resolve. After renaming any files I reccomend you click "Build>Clean Solution" so that the temp build folder is cleaned.

In future versions we will look at a setting that gives more obvious control over the "core override" facility.

Thanks for the report.
  
Back to top
IP Logged
 
MOG_1991
Newbies
*
Offline


Posts: 4
Joined: Feb 7th, 2020
Re: Errors compiling in Atmel (most of errors because of SPI.h)
Reply #4 - Feb 10th, 2020 at 3:19pm
Print Post  
Hi, thanks for your help. But it unfortunately did not work. Now it does not find LiquidCrystal.h and i do not understand why. Here is my new output. Thanks
  

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


Posts: 12136
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Errors compiling in Atmel (most of errors because of SPI.h)
Reply #5 - Feb 10th, 2020 at 3:51pm
Print Post  
It looks like you have switched off "vMicro>Compiler>Deep search for libraries". It needs to be on or you need to add an #include for the LiquidCrystal library to the .ino code.
  
Back to top
IP Logged
 
MOG_1991
Newbies
*
Offline


Posts: 4
Joined: Feb 7th, 2020
Re: Errors compiling in Atmel (most of errors because of SPI.h)
Reply #6 - Feb 10th, 2020 at 4:29pm
Print Post  
Thank you very much my friend everything works now. It was like you said, the confusion with the other Uart. Thanks god job.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint