Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
error: new declaration, error: ambiguates old declaration (Read 3757 times)
mi
Newbies
*
Offline



Posts: 6
error: new declaration, error: ambiguates old declaration
Aug 17th, 2016 at 10:19pm
 
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
 
Visual Micro
Administrator
*****
Offline



Posts: 10381
United Kingdom
Re: error: new declaration, error: ambiguates old declaration
Reply #1 - Aug 17th, 2016 at 11:45pm
 
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

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



Posts: 6
Re: error: new declaration, error: ambiguates old declaration
Reply #2 - Aug 18th, 2016 at 1:15am
 
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
 
Visual Micro
Administrator
*****
Offline



Posts: 10381
United Kingdom
Re: error: new declaration, error: ambiguates old declaration
Reply #3 - Aug 18th, 2016 at 1:26am
 
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
Re: error: new declaration, error: ambiguates old declaration
Reply #4 - Aug 22nd, 2016 at 11:00pm
 
Visual Micro wrote on Aug 18th, 2016 at 1: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..).

Visual Micro wrote on Aug 18th, 2016 at 1: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
 
Visual Micro
Administrator
*****
Offline



Posts: 10381
United Kingdom
Re: error: new declaration, error: ambiguates old declaration
Reply #5 - Aug 22nd, 2016 at 11:10pm
 
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 Topic Print