2015-12-23 10:47:45 [显示全部楼层]
9671浏览
查看: 9671|回复: 7

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

[复制链接]
气象站的程序编译错误,小弟新手求打救,错误信息如下

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 [enabled by default]

#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 [enabled by default]

#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 [enabled by default]

#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 [enabled by default]

#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
编译有误。

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



201508061630215u9hvz.rar

100.17 KB, 下载次数: 2606

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的太阳能气象站套件,发现提供的例程编译出错了,不知道怎么解决

无标题.png
回复

使用道具 举报

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
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
关于楼主

楼主的其它帖子

上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail