aliyun / iotkit-embedded

高速镜像: https://code.aliyun.com/linkkit/c-sdk
Apache License 2.0
496 stars 252 forks source link

cmp-example.c 编译不通过 #82

Open semieie opened 5 years ago

semieie commented 5 years ago

semi@ubuntu:~/iotkit-embedded$ make BUILDING WITH EXISTING CONFIGURATION:

VENDOR : ubuntu MODEL : x86

[CC] iotx_cmp_common.o <= iotx_cmp_common.c
makefile /home/semi/iotkit-embedded/src/cmp/Link-CMP/src/iotx_cmp_common.c:61:19: error: ‘string_TIMESTAMP’ defined but not used [-Werror=unused-const-variable=] static const char string_TIMESTAMP[] CMP_READ_ONLY = "2524608000000"; ^~~~ /home/semi/iotkit-embedded/src/cmp/Link-CMP/src/iotx_cmp_common.c:60:19: error: ‘string_MD5_METHOD’ defined but not used [-Werror=unused-const-variable=] static const char string_MD5_METHOD[] CMP_READ_ONLY = "hmacmd5"; ^~~~~ cc1: all warnings being treated as errors /home/semi/iotkit-embedded/build-rules/_rules-flat.mk:87: recipe for target 'Link-CMP/src/iotx_cmp_common.o' failed make[2]: [Link-CMP/src/iotx_cmp_common.o] Error 1 [CC] mqtt-example.o <= mqtt-example.c
[LD] mqtt-example <= mqtt-example.o
[LD] mqtt_rrpc-example <=
[LD] mqtt_multi_thread-ex <=
[LD] ota_mqtt-example <=
[LD] shadow-example <=
[LD] http-example <=
[LD] cmp-example <= cmp-example.o
cmp/cmp-example.o: In function cmp_client': /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:120: undefined reference toIOT_CMP_Init' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:124: undefined reference to IOT_CMP_Deinit' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:134: undefined reference toIOT_CMP_Register' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:138: undefined reference to IOT_CMP_Deinit' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:145: undefined reference toIOT_CMP_Yield' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:148: undefined reference to IOT_CMP_Deinit' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:174: undefined reference toIOT_CMP_Send' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:182: undefined reference to IOT_CMP_Deinit' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:187: undefined reference toIOT_CMP_Yield' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:190: undefined reference to IOT_CMP_Deinit' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:201: undefined reference toIOT_CMP_Unregister' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:204: undefined reference to IOT_CMP_Deinit' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:209: undefined reference toIOT_CMP_Yield' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:212: undefined reference to IOT_CMP_Deinit' /home/semi/iotkit-embedded/sample/cmp/cmp-example.c:219: undefined reference toIOT_CMP_Deinit' collect2: error: ld returned 1 exit status /home/semi/iotkit-embedded/build-rules/_rules-prog.mk:44: recipe for target 'cmp-example' failed make[3]:
[cmp-example] Error 1 /home/semi/iotkit-embedded/build-rules/_rules-prog.mk:61: recipe for target 'cmp-example' failed make[2]: [cmp-example] Error 2 /home/semi/iotkit-embedded/build-rules/_rules-submods.mk:118: recipe for target 'sample' failed make[1]: [sample] Error 2 /home/semi/iotkit-embedded/build-rules/_rules-submods.mk:5: recipe for target 'sub-mods' failed make: *** [sub-mods] Error 2

你好, 本人在对该项目 执行make 的过程中出现了以上错误,应该是缺少文件导致,但不知道是缺少什么文件。

盼回复,多谢!

biubiuyun commented 5 years ago

我也是这种情况,更换了好几个板本,改头文件都不行,求高人解答

lifang870603 commented 5 years ago

这个是因为使用的编译版本warning检查更为严格,请根据错误提示,把没有使用到的string_TIMESTAMP和hmacmd5注释掉,谢谢