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
conflicting declaration (Read 321 times)
Tomas Lancz
Junior Member
**
Offline



Posts: 12
conflicting declaration
Apr 30th, 2020 at 11: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
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 246
Re: conflicting declaration
Reply #1 - Apr 30th, 2020 at 11: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?
Back to top
 
 
IP Logged
 
Tomas Lancz
Junior Member
**
Offline



Posts: 12
Re: conflicting declaration
Reply #2 - Apr 30th, 2020 at 11: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");
      }
  }
Back to top
« Last Edit: Apr 30th, 2020 at 11:46am by Tomas Lancz »  
 
IP Logged
 
Tomas Lancz
Junior Member
**
Offline



Posts: 12
Re: conflicting declaration
Reply #3 - Apr 30th, 2020 at 11: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...
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 246
Re: conflicting declaration
Reply #4 - Apr 30th, 2020 at 12:18pm
 
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)
Back to top
 
 
IP Logged
 
Tomas Lancz
Junior Member
**
Offline



Posts: 12
Re: conflicting declaration
Reply #5 - Apr 30th, 2020 at 12:31pm
 
Perfect!!! Now it's OK. Many thanks for your support!
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 246
Re: conflicting declaration
Reply #6 - Apr 30th, 2020 at 2: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.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10653
United Kingdom
Re: conflicting declaration
Reply #7 - May 2nd, 2020 at 8:54pm
 
Off-Topic replies have been moved to this Topic.
Back to top
 
WWW  
IP Logged
 
Tomas Lancz
Junior Member
**
Offline



Posts: 12
Re: conflicting declaration
Reply #8 - May 5th, 2020 at 2:18pm
 
Hello,

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

Thank you for support, T
Back to top
 
 
IP Logged
 
Tomas Lancz
Junior Member
**
Offline



Posts: 12
Re: conflicting declaration
Reply #9 - May 6th, 2020 at 7: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
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 246
Re: conflicting declaration
Reply #10 - May 6th, 2020 at 12:30pm
 
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.
Back to top
 
 
IP Logged
 
Tomas Lancz
Junior Member
**
Offline



Posts: 12
Re: conflicting declaration
Reply #11 - May 6th, 2020 at 1: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.
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 246
Re: conflicting declaration
Reply #12 - May 6th, 2020 at 1: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.
Back to top
 
 
IP Logged
 
Tomas Lancz
Junior Member
**
Offline



Posts: 12
Re: conflicting declaration
Reply #13 - May 6th, 2020 at 1:42pm
 
Yes of course...it's just a matter of habit
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print