VS Arduino
Visual Micro >> Installation & Troubleshooting >> conflicting declaration
https://www.visualmicro.com/forums/YaBB.pl?num=1588240943

Message started by Tomas Lancz on Apr 30th, 2020 at 10:02am

Title: conflicting declaration
Post by Tomas Lancz on Apr 30th, 2020 at 10:02am
Hello all,
I'm trying to compile my existing sketch...but after last updating of compiler I got this message:

Compiling 'Propane_sens_1' for 'ATmega328P (3.3V, 8 MHz) (Arduino Pro or Pro Mini)'

arduino.h:30: In file included from
Propane_sens_1.ino: from
Error compiling project sources
Build failed for project 'Propane_sens_1'

tmrint_fnc.ino: 1:5: error: conflicting declaration of 'void __vector_11()' with 'C' linkage
   ISR(TIMER1_COMPA_vect)    \\timer1 interrupt 1kHz
fncs.ino:7: note  previous declaration with C++ linkage

...and I have no idea what to do...
Can anybody help me?

Thank you in advance

Title: Re: conflicting declaration
Post by Simon Hopkinson on Apr 30th, 2020 at 10:31am
Could you attach / email the output as shown at the top in the yellow box, and if possible the sketch so we can reproduce the issue more easily to investigate?

Title: Re: conflicting declaration
Post by Tomas Lancz on Apr 30th, 2020 at 10:40am
// the setup function runs once when you press reset or power the board
void setup()
  {
       
    Serial.begin(9600);
    Serial.println F("");
    Serial.print F("STARTUP");
   
    // noInterrupts();                   // interrupt on Timer1 kHz
    cli();//stop interrupts
    // Clear registers
    TCCR1A = 0;
    TCCR1B = 0;
    TCNT1 = 0;

    // 1000 Hz (8000000/((124+1)*64))
    OCR1A = 124;
    // CTC
    TCCR1B |= (1 << WGM12);
    // Prescaler 64
    TCCR1B |= (1 << CS11) | (1 << CS10);
    // Output Compare Match A Interrupt Enable
    TIMSK1 |= (1 << OCIE1A);

    sei();//allow interrupts
    // interrupts();
    wdt_enable(WDTO_1S);
    wdt_reset();
  }

ISR(TIMER1_COMPA_vect)    //timer1 interrupt 1kHz
  {
    if(OneSecTimer < 1000)  {OneSecTimer++;} 
    if(OneSecTimer == 1000)                      // 1s
      {
        OneSecTimer = 0;
        OneSecTimerSwitch = true;
      }
  }

...and the part of sketch from loop.ino...just for testing if it works

// the loop function runs over and over again until power down or reset
void loop()
  {
    wdt_reset();

    if(OneSecTimerSwitch == true)
      {
        OneSecTimerSwitch = false;
        Serial.println F("TIK-TAK");
      }
  }

Title: Re: conflicting declaration
Post by Tomas Lancz on Apr 30th, 2020 at 10:55am
I checked the interrupt vectors here:
http://ee-classes.usc.edu/ee459/library/documents/avr_intr_vectors/

...and when I substituted the "ISR(TIMER1_COMPA_vect)" with "void __vector_12()", the compilation has done OK...but the code in the processor doesn't work...

Title: Re: conflicting declaration
Post by Simon Hopkinson on Apr 30th, 2020 at 11:18am
Thanks for the information, we have been able to reproduce the issue and will update as soon as we have more information.

While we investigate, disabling the Deep Search may resolve the issue (vMicro > Compiler > Deep Search For Libraries + Accurate Prototype Insertion -- uncheck this option)

Title: Re: conflicting declaration
Post by Tomas Lancz on Apr 30th, 2020 at 11:31am
Perfect!!! Now it's OK. Many thanks for your support!

Title: Re: conflicting declaration
Post by Simon Hopkinson on Apr 30th, 2020 at 1:17pm
We have published a new version (20.03.21.11) with the fix for this issue (so Deep Search can be enabled again as normal once installed).

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Let us know if you have any further issues, or if this doesn't resolve the problem when Deep Search is re-enabled on the updated version.

Title: Re: conflicting declaration
Post by Visual Micro on May 2nd, 2020 at 7:54pm
Off-Topic replies have been moved to this Topic.

Title: Re: conflicting declaration
Post by Tomas Lancz on May 5th, 2020 at 1:18pm
Hello,

Sorry for a delayed reply...I can confirm that it works now...

Thank you for support, T

Title: Re: conflicting declaration
Post by Tomas Lancz on May 6th, 2020 at 6:40am
Hello,

After one of the updating of Visual studio I got this message (I'm working with the ESP32 Dev Module board):

WARNING: Unable to find the start of the setup() method. This is required to initialize the software debugger.

Compiling debug version of 'Propane_main_1' for 'ESP32 Dev Module'
esptool.py v2.6
Program size: 218 993 bytes (used 17% of a 1 310 720 byte maximum) (9,97 secs)
Minimum Memory Usage: 15668 bytes (5% of a 327680 byte maximum)

...it happened when I started the compilation after excluding of "setup" part to the separated ino file...for example for another board (Arduino Pro Mini) it works OK...can you help me with this?

Thank you, Tomas

Title: Re: conflicting declaration
Post by Simon Hopkinson on May 6th, 2020 at 11:30am
This message only appears when the Serial Debugger is enabled, and it expects to find the setup() and loop() functions in the SketchName.ino file.

If you have the Serial Debugger enabled for both boards, the output should state the same message, and if this is not the case please provide logs for both builds.

Title: Re: conflicting declaration
Post by Tomas Lancz on May 6th, 2020 at 12:09pm
Yes you're right...I had set the "release" type of compilation and linking for Arduino Pro Mini...it's a shame...it's more straightaway when I can split the code to the diffrent files...

But thank you for your reply.

Title: Re: conflicting declaration
Post by Simon Hopkinson on May 6th, 2020 at 12:17pm
The only restriction is the setup() and loop() need to be in the sketchName.ino.  You can still call another function from within setup(), from another INO file to separate out the code more easily, whilst keeping the Serial Debug functionality working.

Title: Re: conflicting declaration
Post by Tomas Lancz on May 6th, 2020 at 12:42pm
Yes of course...it's just a matter of habit

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.