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 work with multible ino-files (Read 5759 times)
Uwe
Newbies
*
Offline


Posts: 5
Joined: Dec 13th, 2015
work with multible ino-files
Jan 17th, 2017 at 2:11pm
Print Post  
With the arduino IDE my projects with 6 ino-file work fine, no errors, etc.
With VS2015 and VisualMicro I get a couple of "'xxx' was not declared in this scope".
How to fix these errors

Best Regards Uwe
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: work with multible ino-files
Reply #1 - Jan 17th, 2017 at 4:12pm
Print Post  
Hi,

Normally visual micro adds the .ino files to the project each time it is opened if they are missing.

Maybe re-opening your project will do this.

Otherwise, click the project node in the solution explorer. Then click the small icon with a tip called "Show all files"

You should then see the .ino files with a little read mark next to them.

Right click and click "Include in project"

You can highlight more than one file at a time using CTRL+Click then right click and "include" them all with one more click

In the default mode, Only the files that are actually included in the project are compiled.

Does this make sense or am i missing the point?

If this doesn't make sense please zip and email your project to info[at]visualmicro.com

Thanks
  
Back to top
IP Logged
 
Uwe
Newbies
*
Offline


Posts: 5
Joined: Dec 13th, 2015
Re: work with multible ino-files
Reply #2 - Jan 17th, 2017 at 5:51pm
Print Post  
Hi Tim

not the re-opening, but the rest solved my problem.

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: work with multible ino-files
Reply #3 - Jan 17th, 2017 at 7:39pm
Print Post  
Thanks, I will look at the auto add on open.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: work with multible ino-files
Reply #4 - Jan 17th, 2017 at 7:50pm
Print Post  
I just looked at this and have a question...

Visual Micro Commands

If you open an existing arduino sketch using "file>open>arduino project" the .ino files are automatically created in a visual studio project.

If you subsequently manually copy .ino files to the project folder and use "file>open>arduino project" the new files are detect and added to the project.

Visual Studio Standard Commands

If you use the standard visual studio commands to open an existing solution(.sln) or project(.vxcproj) then any missing .ino files must be manually included in the project.

Question

Can you please walk me through how you created the project and how/when the additional .ino files were added to the folder.

Thanks very much
« Last Edit: Jan 17th, 2017 at 7:50pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Uwe
Newbies
*
Offline


Posts: 5
Joined: Dec 13th, 2015
Re: work with multible ino-files
Reply #5 - Jan 18th, 2017 at 8:13am
Print Post  
Hi Tim

I did "file>open>arduino project" and did not add inó files later.
But the the reason for my problem was different.
It had nothing to do with multible ino-file, which I suspected, but I had in my main ino file the following commands:

#include <N2kCANMsg.h>
#include <ActisenseReader.h>
const int ledBuiltin = LED_BUILTIN;
const int ledFront   = 21;    // front LED
#include <LiquidCrystal.h>
#include <LCDMenuLib.h>

This leeds to the really irritation error msgs.
After changing the sequence to: 

#include <N2kCANMsg.h>
#include <ActisenseReader.h>
#include <LiquidCrystal.h>
#include <LCDMenuLib.h>
const int ledBuiltin = LED_BUILTIN;
const int ledFront   = 21;    // front LED

everything works fine. I did not know the importance of this order and the error msg is not helpful at all AND in arduino IDE it did work

Best Regards Uwe


« Last Edit: Jan 18th, 2017 at 12:57pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: work with multible ino-files
Reply #6 - Jan 18th, 2017 at 1:08pm
Print Post  
Thanks for the info.

Up until last year Arduino was the same. They put in a  new system to cater for this which hasn't been implemented in visual micro yet because it makes debugging more difficult.

The issue is because the #include "arduino.h" and function prototypes have to be added by visual micro in background during compilation and the insert position is deduced from the first line of code (not #defines)


#include <N2kCANMsg.h>
#include <ActisenseReader.h>
#include <LiquidCrystal.h>
#include <LCDMenuLib.h>

#define xyz 10

//
//function prototypes go here
//

const int ledBuiltin = LED_BUILTIN;
const int ledFront   = 21;    // front LED

If you switch on "vMicro>Compiler>Show build folder" you will see the build folder and the project_name.cpp (all the ino files) that contains additional arduino code inserted into it.

This is due to be addressed shortly but everything else it working well at the moment and it will be an upheaval
« Last Edit: Jan 18th, 2017 at 1:09pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: work with multible ino-files
Reply #7 - Jan 20th, 2017 at 9:12pm
Print Post  
Did this solution make sense to you?

Thanks
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint