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
Hot Topic (More than 8 Replies) main.cpp and INO file showing up? (Read 7146 times)
IanS
Junior Member
**
Offline


Posts: 14
Joined: Jun 29th, 2016
main.cpp and INO file showing up?
Aug 15th, 2016 at 6:43pm
Print Post  
Im used to using VS for all my arduino dev work but I am looking at switching to atmel studio so that I can use an ICE debugger. So I was messing around and testing out VM in AS and I noticed that when I create a project in AS using a VM template I get both a main.CPP files and a [project name].INO. What is the purpose of the main.CPP file? Can I program directly in it and get rid of the .ino file? Is it a byproduct of using atmel studio? Or something entirely different? 

But, in neither file does it detect the arduino core and allow me access things such as Serial.println() millis() etc. If I try to include "Arduino.h" it is unable to fine it. It appears that maybe I missed a setup step?

Any help would be appreciated.

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: main.cpp and INO file showing up?
Reply #1 - Aug 15th, 2016 at 9:32pm
Print Post  
Atmel creates files automatically for no good reason. It's just one reason why I don't recommend it. Delete the main.cpp
  
Back to top
WWW  
IP Logged
 
IanS
Junior Member
**
Offline


Posts: 14
Joined: Jun 29th, 2016
Re: main.cpp and INO file showing up?
Reply #2 - Aug 16th, 2016 at 12:39pm
Print Post  
Ok thanks. Am I correct there is no way to do away with INO file and just use a straight c/c++ file?

Also, its still not picking up the arduino core. Any possible fixes?
« Last Edit: Aug 16th, 2016 at 12:39pm by IanS »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: main.cpp and INO file showing up?
Reply #3 - Aug 16th, 2016 at 12:43pm
Print Post  
Visual Micro always uses at least one .ino but it only needs to contain setup and loop

There are some advanced options that give more control but they are not supported and only worth taking about for experienced arduino/vm users.

If the core isn't being picked up then please confirm the project name, folder name and .ino name all match and are in the same location.

Try switching to another board and back again which is one way to force an intellisense refresh

Failing that email a zip of the project folder to info[at]visualmicro.com

  
Back to top
WWW  
IP Logged
 
IanS
Junior Member
**
Offline


Posts: 14
Joined: Jun 29th, 2016
Re: main.cpp and INO file showing up?
Reply #4 - Aug 16th, 2016 at 1:14pm
Print Post  
Still not working /: Sent you an email!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: main.cpp and INO file showing up?
Reply #5 - Aug 16th, 2016 at 3:15pm
Print Post  
I can't see the email so please send again along with link back to this post

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: main.cpp and INO file showing up?
Reply #6 - Aug 16th, 2016 at 3:32pm
Print Post  
I have the email now and will look thanks
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: main.cpp and INO file showing up?
Reply #7 - Aug 16th, 2016 at 3:33pm
Print Post  
Okay you can still see the main.cpp in the sketch folder so that is the problem.

I expect you "Removed" it from the atmel studio solution but you needed to click "Delete". 

Please use windows file explorer and delete the main.cpp from the project folder then reopen the ide just to be sure/clean.

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: main.cpp and INO file showing up?
Reply #8 - Aug 18th, 2016 at 8:40pm
Print Post  
ps

1) if you create a .cpp with the same name as the project then the .ino files will be ignored during compilation.

2) I'm going to see if I can get the ice working in visual studio. that would be easier to support.
« Last Edit: Aug 18th, 2016 at 8:41pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint