亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1708 | 回復(fù): 4
打印 上一主題 下一主題

[C++] 請教在g++下面,這份簡單的代碼編譯不過,有解決辦法嗎? [復(fù)制鏈接]

論壇徽章:
1
2015元宵節(jié)徽章
日期:2015-03-06 15:52:30
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2015-05-16 13:13 |只看該作者 |倒序瀏覽
  1. #include "stdio.h"
  2. #include <time.h>
  3. #include <sys/time.h>
  4. #include <math.h>
  5. #include <string.h>
  6. #include <sys/ioctl.h>
  7. #include <unistd.h>
  8. #include <fcntl.h>
  9. #include "errno.h"
  10. #include <pthread.h>
  11. #include <stdint.h>
  12. #include <signal.h>
  13. #include<sys/time.h>
  14. #include <sys/types.h>
  15. #include <sys/stat.h>
  16. #include <dirent.h>
  17. #include <sys/types.h>
  18. #include <sys/socket.h>
  19. #include <sys/syscall.h>
  20. #include <sys/select.h>
  21. #include <ctype.h>
  22. #include <limits.h>


  23. typedef enum {
  24.   QMI_RESULT_TYPE_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.  Do not change or use*/
  25.   QMI_RESULT_SUCCESS_V01 = 0,
  26.   QMI_RESULT_FAILURE_V01 = 1,
  27.   QMI_RESULT_TYPE_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/
  28. }qmi_result_type_v01;


  29. typedef struct {

  30.   qmi_result_type_v01 result;
  31.   /**<   Result code
  32.                             - QMI_RESULT_SUCCESS
  33.                             - QMI_RESULT_FAILURE
  34.                           */

  35. }qmi_response_type_v01;  /* Type */


  36. typedef struct {

  37.   /* Mandatory */
  38.   /*  Result Code */
  39.   /**<   Standard response type. */

  40.   /* int ab; */ //但如果我加上這個int ab后,再用g++ test.c,是可以編譯過的。
  41.   qmi_response_type_v01 resp;

  42.   /**<   \n
  43.        (Extended sizes to accommodate LTE.)
  44.   */
  45. }nas_get_rf_band_info_resp_msg_v01;  /* Message */



  46. int main(int argc, char **argv)
  47. {
  48.     int s;
  49.     int ret;

  50.     nas_get_rf_band_info_resp_msg_v01 getBandResp = {0};
  51.         while (1);
  52.    
  53.     return 0;
  54. }
復(fù)制代碼
上面是我提取出來的代碼。鑒于項目的原因,我們不能修改makefile,也最好不要先分配getBandResp后再用memset,請問大俠有什么解決辦法呢?
謝謝!

如果用gcc編譯,是可以的,但g++編譯就出錯:
test111.c: In function 鈥榠nt main(int, char**)鈥

                                                  test111.c:333:55: error: invalid conversion from 鈥榠nt鈥to 鈥榪mi_result_type_v01鈥[-fpermissive]
     nas_get_rf_band_info_resp_msg_v01 getBandResp = {0};

論壇徽章:
36
子鼠
日期:2013-08-28 22:23:29黃金圣斗士
日期:2015-12-01 11:37:51程序設(shè)計版塊每日發(fā)帖之星
日期:2015-12-14 06:20:00CU十四周年紀念徽章
日期:2015-12-22 16:50:40IT運維版塊每日發(fā)帖之星
日期:2016-01-25 06:20:0015-16賽季CBA聯(lián)賽之深圳
日期:2016-01-27 10:31:172016猴年福章徽章
日期:2016-02-18 15:30:3415-16賽季CBA聯(lián)賽之福建
日期:2016-04-07 11:25:2215-16賽季CBA聯(lián)賽之青島
日期:2016-04-29 18:02:5915-16賽季CBA聯(lián)賽之北控
日期:2016-06-20 17:38:50技術(shù)圖書徽章
日期:2016-07-19 13:54:03程序設(shè)計版塊每日發(fā)帖之星
日期:2016-08-21 06:20:00
2 [報告]
發(fā)表于 2015-05-16 14:36 |只看該作者
如果用gcc編譯,是可以的,但g++編譯就出錯:
test111.c: In function 鈥榠nt main(int, char**)鈥

                                                  test111.c:333:55: error: invalid conversion from 鈥榠nt鈥to 鈥榪mi_result_type_v01鈥[-fpermissive]
     nas_get_rf_band_info_resp_msg_v01 getBandResp = {0};


樓主貼的報錯也是醉了。。

論壇徽章:
36
子鼠
日期:2013-08-28 22:23:29黃金圣斗士
日期:2015-12-01 11:37:51程序設(shè)計版塊每日發(fā)帖之星
日期:2015-12-14 06:20:00CU十四周年紀念徽章
日期:2015-12-22 16:50:40IT運維版塊每日發(fā)帖之星
日期:2016-01-25 06:20:0015-16賽季CBA聯(lián)賽之深圳
日期:2016-01-27 10:31:172016猴年福章徽章
日期:2016-02-18 15:30:3415-16賽季CBA聯(lián)賽之福建
日期:2016-04-07 11:25:2215-16賽季CBA聯(lián)賽之青島
日期:2016-04-29 18:02:5915-16賽季CBA聯(lián)賽之北控
日期:2016-06-20 17:38:50技術(shù)圖書徽章
日期:2016-07-19 13:54:03程序設(shè)計版塊每日發(fā)帖之星
日期:2016-08-21 06:20:00
3 [報告]
發(fā)表于 2015-05-16 14:37 |只看該作者
改成
  1. nas_get_rf_band_info_resp_msg_v01 getBandResp = {qmi_result_type_v01(0)};
復(fù)制代碼
或者
  1. nas_get_rf_band_info_resp_msg_v01 getBandResp = {QMI_RESULT_SUCCESS_V01};
復(fù)制代碼

論壇徽章:
36
子鼠
日期:2013-08-28 22:23:29黃金圣斗士
日期:2015-12-01 11:37:51程序設(shè)計版塊每日發(fā)帖之星
日期:2015-12-14 06:20:00CU十四周年紀念徽章
日期:2015-12-22 16:50:40IT運維版塊每日發(fā)帖之星
日期:2016-01-25 06:20:0015-16賽季CBA聯(lián)賽之深圳
日期:2016-01-27 10:31:172016猴年福章徽章
日期:2016-02-18 15:30:3415-16賽季CBA聯(lián)賽之福建
日期:2016-04-07 11:25:2215-16賽季CBA聯(lián)賽之青島
日期:2016-04-29 18:02:5915-16賽季CBA聯(lián)賽之北控
日期:2016-06-20 17:38:50技術(shù)圖書徽章
日期:2016-07-19 13:54:03程序設(shè)計版塊每日發(fā)帖之星
日期:2016-08-21 06:20:00
4 [報告]
發(fā)表于 2015-05-16 14:38 |只看該作者
不過盡量不要用implicity為好

論壇徽章:
1
2015元宵節(jié)徽章
日期:2015-03-06 15:52:30
5 [報告]
發(fā)表于 2015-05-16 18:28 |只看該作者
cool!
Thanks!
回復(fù) 3# cokeboL


   
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP