xiluoyuy 发表于 2015-12-23 10:47:45

气象站程序编译错误,求助

气象站的程序编译错误,小弟新手求打救,错误信息如下

Arduino:1.6.7 (Windows 10), 开发板:"LilyPad Arduino USB"

In file included from C:\Program Files (x86)\Arduino\libraries\WeatherStation\example\example.ino:26:0:

C:\Program Files (x86)\Arduino\libraries\public/public.h:64:0: warning: "INT16_MIN" redefined

#define INT16_MIN -32768

^

In file included from c:\program files (x86)\arduino\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h:9:0,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\inttypes.h:37,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:86,

               from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

               from sketch\example.ino.cpp:1:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdint.h:332:0: note: this is the location of the previous definition

#define INT16_MIN (-INT16_MAX - 1)

^

In file included from C:\Program Files (x86)\Arduino\libraries\WeatherStation\example\example.ino:26:0:

C:\Program Files (x86)\Arduino\libraries\public/public.h:65:0: warning: "INT16_MAX" redefined

#define INT16_MAX 32767

^

In file included from c:\program files (x86)\arduino\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h:9:0,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\inttypes.h:37,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:86,

               from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

               from sketch\example.ino.cpp:1:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdint.h:327:0: note: this is the location of the previous definition

#define INT16_MAX 0x7fff

^

In file included from C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp:35:0:

C:\Program Files (x86)\Arduino\libraries\public/public.h:64:0: warning: "INT16_MIN" redefined

#define INT16_MIN -32768

^

In file included from c:\program files (x86)\arduino\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h:9:0,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\inttypes.h:37,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\sfr_defs.h:126,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\sleep.h:38,

               from C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp:32:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdint.h:332:0: note: this is the location of the previous definition

#define INT16_MIN (-INT16_MAX - 1)

^

In file included from C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp:35:0:

C:\Program Files (x86)\Arduino\libraries\public/public.h:65:0: warning: "INT16_MAX" redefined

#define INT16_MAX 32767

^

In file included from c:\program files (x86)\arduino\hardware\tools\avr\lib\gcc\avr\4.8.1\include\stdint.h:9:0,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\inttypes.h:37,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\sfr_defs.h:126,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99,

               from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\sleep.h:38,

               from C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp:32:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdint.h:327:0: note: this is the location of the previous definition

#define INT16_MAX 0x7fff

^

C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp: In member function 'void WeatherStation::displayNext()':

C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp:474:40: error: invalid initialization of reference of type 'uint8_t& {aka unsigned char&}' from expression of type 'boolean {aka bool}'

   uint8_t &dateShowFlag = displayMgt.dateShowFlag;

                                        ^

C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp: In member function 'void DataWarehouse::init(uint16_t, uint8_t, uint8_t, uint8_t)':

C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp:1188:73: warning: large integer implicitly truncated to unsigned type [-Woverflow]

         eeprom_write_byte( (uint8_t *)STORE_ADDR_VALIDFLAG, ~DATA_VALID );

                                                                         ^

C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp: In member function 'void DataWarehouse::updateDate(uint16_t, uint8_t, uint8_t)':

C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp:1282:69: warning: large integer implicitly truncated to unsigned type [-Woverflow]

   eeprom_write_byte( (uint8_t *)STORE_ADDR_VALIDFLAG, ~DATA_VALID );

                                                                     ^

C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp: In member function 'void DataWarehouse::putData(int16_t, uint8_t, uint8_t)':

C:\Program Files (x86)\Arduino\libraries\WeatherStation\WeatherStation.cpp:1361:69: warning: large integer implicitly truncated to unsigned type [-Woverflow]

   eeprom_write_byte( (uint8_t *)STORE_ADDR_VALIDFLAG, ~DATA_VALID );

                                                                     ^

exit status 1
编译有误。

报告将会包含更多的信息
"在编译时,输出详细信息"
在 文件>首选项 中启用



swanglei 发表于 2015-12-23 16:42:43

你加DFRobot -Arduino的qq群(150455368)

swanglei 发表于 2015-12-23 16:43:27

以后有问题可以到qq群里问的,你在做什么作品吗?可以发到社区来,一起学习一下。

xiluoyuy 发表于 2015-12-23 17:59:56

swanglei 发表于 2015-12-23 16:43
以后有问题可以到qq群里问的,你在做什么作品吗?可以发到社区来,一起学习一下。 ...

就是DFRobot的太阳能气象站套件,发现提供的例程编译出错了,不知道怎么解决

Cain 发表于 2015-12-25 11:28:37

本帖最后由 Cain 于 2015-12-25 11:29 编辑

是不是没有加载库。程序样例里有库文件下载,安装方式看这里https://www.dfrobot.com.cn/commun ... viewthread&tid=1854,然后编译的话用1.0.6去编译,应该就可以了

dsweiliang 发表于 2015-12-29 09:22:54

期待大神帮忙啦

fats114 发表于 2016-12-19 23:52:04

库文件有错误,    WeatherStation.h这个文件474行,定义的数据类型错误应改为“bool &dateShowFlag = displayMgt.dateShowFlag;“
dateShowFlag的数据类型是bool不是uint_8

senghu 发表于 2017-2-1 19:55:06

我也遇到同样的问题,根据楼上的提示,我在 WeatherStation.cpp文件的474行找到了数据类型错误,把uint_8改成boolean后,再次编译就OK了!希望能帮助遇到同样问题的TX
页: [1]
查看完整版本: 气象站程序编译错误,求助