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 error: new declaration, error: ambiguates old declaration (Read 6623 times)
mi
Newbies
*
Offline


Posts: 6
Joined: Aug 16th, 2016
error: new declaration, error: ambiguates old declaration
Aug 17th, 2016 at 9:19pm
Print Post  
Hello

I am getting this when attempting to compile a known working sketch in Atmel Studio 7 with Visual Micro:

sketch.ino:203:24: error: new declaration 'void TFTwrite(uint8_t)
:void TFTwrite(uint8_t c)
sketch.ino:202:8: error: ambiguates old declaration 'size_t TFTwrite(uint8_t)
:size_t TFTwrite(uint8_t c)
Error compiling project sources


This declaration does not appear in sketch.ino, but instead in another file that is part of the project, so it seems something buggy is with the error reporting.

More importantly though, what does this mean and how do I fix it?

I have, in the other file:
#if ARDUINO >= 100
size_t TFTwrite(uint8_t c) {
#else
void TFTwrite(uint8_t c) {
#endif

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: new declaration, error: ambiguates old declaration
Reply #1 - Aug 17th, 2016 at 10:45pm
Print Post  
Hi,

#if ARDUINO >= 100 was used in sketches to distinguish between arduino version pre arduino 1.0. > 100 means 10.0 and above so you can remove the #else because <100 was discontinued years ago.

Normal the syntax was only used to include either arduino.h or the older wprogram.h

« Last Edit: Aug 17th, 2016 at 10:46pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
mi
Newbies
*
Offline


Posts: 6
Joined: Aug 16th, 2016
Re: error: new declaration, error: ambiguates old declaration
Reply #2 - Aug 18th, 2016 at 12:15am
Print Post  
Thank you. That has fixed it  Smiley, however I don't understand why it was not working previously since I have ARDUINO defined as 10609, so the #else inclusion should not have been compiling.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: new declaration, error: ambiguates old declaration
Reply #3 - Aug 18th, 2016 at 12:26am
Print Post  
What do you mean by previously. What vm/atmel/arduino/ide versions

Is the code in an .ino file?

If in a .ino then maybe you switch off project property Auto Generate Prototypes n the past and the setting was lost. Do you remember switching that off in the past?
  
Back to top
WWW  
IP Logged
 
mi
Newbies
*
Offline


Posts: 6
Joined: Aug 16th, 2016
Re: error: new declaration, error: ambiguates old declaration
Reply #4 - Aug 22nd, 2016 at 10:00pm
Print Post  
Tim@Visual Micro wrote on Aug 18th, 2016 at 12:26am:
What do you mean by previously. What vm/atmel/arduino/ide versions


I mean the same project compiled under Arduino IDE 1.6.9 under Windows 10. Target is a Arduiono DUE equivalent (SAM3X8E..).

Tim@Visual Micro wrote on Aug 18th, 2016 at 12:26am:
Is the code in an .ino file?

If in a .ino then maybe you switch off project property Auto Generate Prototypes n the past and the setting was lost. Do you remember switching that off in the past?


Yes it is in an .ino file. Under the project properties "Generate Prototypes" is set to true - is this the same as what you mean? I haven't toggled this.

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: new declaration, error: ambiguates old declaration
Reply #5 - Aug 22nd, 2016 at 10:10pm
Print Post  
I am struggling to fully understand the picture. Please can you supply the following three bits of info.

1)
can you please switch on vmicro>compiler>verbose and then try to build. post the output as a .txt or email to info[at]visualmicro.com with a link to this post.

2)
please confirm if the same code works or fails when using the arduino 1.6.10

3)
if the same code works in visual micro when pointed to arduino 1.6.9?

finally a note ...

For testing you can easily install multiple copies of the arduino ide by using the zip installer from the arduino.cc downloads page.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint