WeatherDuino Forum
Plus has errors compiling - Printable Version

+- WeatherDuino Forum (https://www.meteocercal.info/forum)
+-- Forum: Weather Stations - WeatherDuino Pro2 Line (https://www.meteocercal.info/forum/forum-4.html)
+--- Forum: Software Questions (https://www.meteocercal.info/forum/forum-10.html)
+--- Thread: Plus has errors compiling (/thread-985.html)

Pages: 1 2


Plus has errors compiling - markkkk42 - 11-01-2017

Hi Werk_AG

I loaded all the libraries and and using V1.8.0 but when I try to compile the code it comes up with this error

Arduino: 1.8.0 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

/Users/Mark/Downloads/WeatherDuino_Pro2_PLUS/v1.0/software/RX software/WeatherDuinoPro2Plus_RX_v100_b016/Routines.ino: In function 'void RunEvery_1_Minute()':
Routines:177: error: 'WU_upload' was not declared in this scope
         WU_upload();
                   ^
Multiple libraries were found for "EEPROM.h"
 Used: /Applications/Arduino 2.app/Contents/Java/hardware/arduino/avr/libraries/EEPROM
 Not used: /Users/Mark/Documents/Arduino/libraries/EEPROM
exit status 1
'WU_upload' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


RE: Plus has errors compiling - roddyp - 11-01-2017

Yes, I see the same thing. It's because the WU_Upload function in net.ino is not compiled due to a #if, but it's still being called.

I think the fix would be to modify Routines.ino from this...

Code:
     if ( Enable_Internet == 1 && Enable_WUupload == 1 && localMinute % WUupload_period == 0)
      {
        WU_upload();
      }  

... to this (untested!)...

Code:
      #if (Enable_Internet == 1) && (Enable_WUupload == 1)
       if (localMinute % WUupload_period == 0)
        {
          WU_upload();
       }  
     #endif


It's C 'best practice' to use upper-case names for preprocessor defines, so it's easier to spot them. e.g ENABLE_INTERNET, ENABLE_WU_UPLOAD.


RE: Plus has errors compiling - werk_ag - 11-01-2017

(11-01-2017, 08:40)markkkk42 Wrote:  Hi Werk_AG

I loaded all the libraries and and using V1.8.0 but when I try to compile the code it comes up with this error

Hi,

Thanks for the report.
Please download it again, I have updated the software package.


RE: Plus has errors compiling - werk_ag - 11-01-2017

(11-01-2017, 12:27)roddyp Wrote:  I think the fix would be to modify Routines.ino from this...

Hi roddyp,

Yes, the proposed fix, solves the compiling error. Thanks
It seems that 1.8.0 introduced some unexpected problems than just the problem with the "Time" library.
I still haven't check if they changed the compiler version or just the optimization options, but it seems less "clever" now Sad .

Regards


RE: Plus has errors compiling - roddyp - 11-01-2017

(11-01-2017, 20:39)Werk_AG Wrote:  It seems that 1.8.0 introduced some unexpected problems than just the problem with the "Time" library.
I think it's because of the way Arduino code gets 'massaged' into acceptable C/C++ by the IDE, creating any missing function prototypes. I guess  this has changed to not generate prototypes when functions are excluded by the preprocessor. Either that or a bug in the way these prototypes are now generated.
The following code won't compile in 1.8.0 - I'll see if it does in 1.6.x

Code:
#ifdef WIBBLE
void foo()
{
}
#endif

void setup() {
  foo();
}

void loop() {
}

Updated : This won't compile in 1.6 either. Maybe you're not seeing problems because your build has a different config file?

Oh - and I see 1.8.1 is here now Wink


RE: Plus has errors compiling - werk_ag - 11-01-2017

(11-01-2017, 22:42)roddyp Wrote:  Oh - and I see 1.8.1 is here now Wink

... and it solves the problem with the font rendering.

Code:
ARDUINO 1.8.1 - 2017.01.09

[ide]
* Fixed font rendering not anti-aliased on Windows (regression)
* Increased number of colors on serial plotter to 8, thanks @cousteaulecommandant



RE: Plus has errors compiling - werk_ag - 12-01-2017

(11-01-2017, 22:42)roddyp Wrote:  ... the way Arduino code gets 'massaged' into acceptable C/C++ by the IDE, ...

I believe this was the key of the success of the Arduino... it was done to be easy to use by people (like me) that aren't professional programmers. Its ease of use allowed thousands of people to initiate in the programming world.
This was happen with me too, I never have programed strictly in C. I started just 4 years ago with the Arduino IDE. During this time I read a lot about this matter, and I understand why the purists of C, aren't big fans of the Arduino IDE environment. I hope the Arduino IDE builders don't loose their initial vision.


RE: Plus has errors compiling - markkkk42 - 12-01-2017

arduino is now V1.8.1 didnt take long...will try to compile it with this version and your code mods


RE: Plus has errors compiling - markkkk42 - 12-01-2017

Werk I see you have changed the code in the download file. I just dloaded the version from the forum and compiled it on V1.8.1 with those changes in it and it compiles fine..thanks for your help Roddyp


RE: Plus has errors compiling - markkkk42 - 12-01-2017

For the Nano V3 I used the nano in the selection list for the TX and it has compiling errors the WD using the nano selection compiles fine though so the TX board has errors


Arduino: 1.8.1 (Mac OS X), Board: "Arduino Nano, ATmega328"


WeatherDuino_Pro2_TX_v2.0_b013:193: error: no matching function for call to 'OneWire::OneWire()'
OneWire oneWire; // When instantiated with no parameters, uses I2C address 18
^
/Users/Work/Downloads/WeatherDuino_Pro2_PLUS/v1.0/software/TX software/WeatherDuino_Pro2_TX_v2.0_b013/WeatherDuino_Pro2_TX_v2.0_b013.ino:193:9: note: candidates are:
In file included from /Users/Work/Downloads/WeatherDuino_Pro2_PLUS/v1.0/software/TX software/WeatherDuino_Pro2_TX_v2.0_b013/WeatherDuino_Pro2_TX_v2.0_b013.ino:18:0:
/Users/Work/Documents/Arduino/libraries/OneWire/OneWire.h:127:5: note: OneWire::OneWire(uint8_t)
OneWire( uint8_t pin);
^
/Users/Work/Documents/Arduino/libraries/OneWire/OneWire.h:127:5: note: candidate expects 1 argument, 0 provided
/Users/Work/Documents/Arduino/libraries/OneWire/OneWire.h:112:7: note: constexpr OneWire::OneWire(const OneWire&)
class OneWire
^
/Users/Work/Documents/Arduino/libraries/OneWire/OneWire.h:112:7: note: candidate expects 1 argument, 0 provided
/Users/Work/Documents/Arduino/libraries/OneWire/OneWire.h:112:7: note: constexpr OneWire::OneWire(OneWire&&)
/Users/Work/Documents/Arduino/libraries/OneWire/OneWire.h:112:7: note: candidate expects 1 argument, 0 provided
Multiple libraries were found for "EEPROM.h"
Used: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/EEPROM
Not used: /Users/Work/Documents/Arduino/libraries/EEPROM
Multiple libraries were found for "OneWire.h"
Used: /Users/Work/Documents/Arduino/libraries/OneWire
Not used: /Users/Work/Documents/Arduino/libraries/DS2482OneWire
Multiple libraries were found for "DallasTemperature.h"
Used: /Users/Work/Documents/Arduino/libraries/DallasTemperature
Not used: /Users/Work/Documents/Arduino/libraries/Arduino-Temperature-Control-Library-master
Using library VirtualWire in folder: /Users/Work/Documents/Arduino/libraries/VirtualWire (legacy)
Using library Wire at version 1.0 in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire
Using library OneWire in folder: /Users/Work/Documents/Arduino/libraries/OneWire (legacy)
Using library DallasTemperature at version 3.7.5 in folder: /Users/Work/Documents/Arduino/libraries/DallasTemperature
Using library Adafruit_ADS1X15 at version 1.0.0 in folder: /Users/Work/Documents/Arduino/libraries/Adafruit_ADS1X15
Using library Adafruit_SHT31 at version 1.0.0 in folder: /Users/Work/Documents/Arduino/libraries/Adafruit_SHT31
Using library SHT1x in folder: /Users/Work/Documents/Arduino/libraries/SHT1x (legacy)
Using library SHT21 in folder: /Users/Work/Documents/Arduino/libraries/SHT21 (legacy)
Using library HTU21D in folder: /Users/Work/Documents/Arduino/libraries/HTU21D (legacy)
Using library DHTxx in folder: /Users/Work/Documents/Arduino/libraries/DHTxx (legacy)
Using library Timer in folder: /Users/Work/Documents/Arduino/libraries/Timer (legacy)
Using library RunningAverage in folder: /Users/Work/Documents/Arduino/libraries/RunningAverage (legacy)
Using library EEPROM at version 2.0 in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/EEPROM
Using library LiquidCrystal-I2C in folder: /Users/Work/Documents/Arduino/libraries/LiquidCrystal-I2C (legacy)
exit status 1
no matching function for call to 'OneWire::OneWire()'