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 Compiling in arduino not in visual studio... (Read 837 times)
Itsmetoo
Junior Member
**
Offline


Posts: 15
Joined: Jan 25th, 2015
Compiling in arduino not in visual studio...
Apr 1st, 2019 at 8:23am
Print Post  
I guess it is a cache issue or something...
Any idea?




struct teststruct
{
     byte     a;
};

bool testsfunc(teststruct* b)
{
     return true;
}

void setup()
{
}

void loop()
{
}



 
deleteme4.ino: 2:16: error: 'teststruct' was not declared in this scope
 
deleteme4.ino: 2:28: error: 'b' was not declared in this scope
 
Error compiling project sources
deleteme4.ino: In function bool testsfunc(teststruct*)
 
deleteme4.ino: 7:29: error: 'bool testsfunc(teststruct*)' redeclared as different kind of symbol
   bool testsfunc(teststruct* b)
deleteme4.ino:2: note  previous declaration bool testsfunc
Build failed for project 'deleteme4'
« Last Edit: Apr 1st, 2019 at 8:28am by Itsmetoo »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling in arduino not in visual studio...
Reply #1 - Apr 1st, 2019 at 10:44am
Print Post  
You need to add the prototype between the struct and the function that uses it or put your types in a .h file and add an #include. It's an area that has improved in arduino ide but still not 100% correct so we haven't implemented it yet. Probably re-look at it during the next few months.

Code (C++)
Select All
struct teststruct
{
	byte     a;
};

bool testsfunc(teststruct* b);

bool testsfunc(teststruct* b)
{
	return true;
}

void setup()
{
}

void loop()
{
}
 

« Last Edit: Apr 1st, 2019 at 1:39pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Itsmetoo
Junior Member
**
Offline


Posts: 15
Joined: Jan 25th, 2015
Re: Compiling in arduino not in visual studio...
Reply #2 - Apr 1st, 2019 at 1:32pm
Print Post  
You are amazing

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