亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区
Chinaunix
標(biāo)題:
請(qǐng)教在g++下面,這份簡單的代碼編譯不過,有解決辦法嗎?
[打印本頁]
作者:
fire_vr
時(shí)間:
2015-05-16 13:13
標(biāo)題:
請(qǐng)教在g++下面,這份簡單的代碼編譯不過,有解決辦法嗎?
#include "stdio.h"
#include <time.h>
#include <sys/time.h>
#include <math.h>
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <fcntl.h>
#include "errno.h"
#include <pthread.h>
#include <stdint.h>
#include <signal.h>
#include<sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/syscall.h>
#include <sys/select.h>
#include <ctype.h>
#include <limits.h>
typedef enum {
QMI_RESULT_TYPE_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/
QMI_RESULT_SUCCESS_V01 = 0,
QMI_RESULT_FAILURE_V01 = 1,
QMI_RESULT_TYPE_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/
}qmi_result_type_v01;
typedef struct {
qmi_result_type_v01 result;
/**< Result code
- QMI_RESULT_SUCCESS
- QMI_RESULT_FAILURE
*/
}qmi_response_type_v01; /* Type */
typedef struct {
/* Mandatory */
/* Result Code */
/**< Standard response type. */
/* int ab; */ //但如果我加上這個(gè)int ab后,再用g++ test.c,是可以編譯過的。
qmi_response_type_v01 resp;
/**< \n
(Extended sizes to accommodate LTE.)
*/
}nas_get_rf_band_info_resp_msg_v01; /* Message */
int main(int argc, char **argv)
{
int s;
int ret;
nas_get_rf_band_info_resp_msg_v01 getBandResp = {0};
while (1);
return 0;
}
復(fù)制代碼
上面是我提取出來的代碼。鑒于項(xiàng)目的原因,我們不能修改makefile,也最好不要先分配getBandResp后再用memset,請(qǐng)問大俠有什么解決辦法呢?
謝謝!
如果用gcc編譯,是可以的,但g++編譯就出錯(cuò):
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};
作者:
cokeboL
時(shí)間:
2015-05-16 14:36
如果用gcc編譯,是可以的,但g++編譯就出錯(cuò):
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};
樓主貼的報(bào)錯(cuò)也是醉了。。
作者:
cokeboL
時(shí)間:
2015-05-16 14:37
改成
nas_get_rf_band_info_resp_msg_v01 getBandResp = {qmi_result_type_v01(0)};
復(fù)制代碼
或者
nas_get_rf_band_info_resp_msg_v01 getBandResp = {QMI_RESULT_SUCCESS_V01};
復(fù)制代碼
作者:
cokeboL
時(shí)間:
2015-05-16 14:38
不過盡量不要用implicity為好
作者:
fire_vr
時(shí)間:
2015-05-16 18:28
cool!
Thanks!
回復(fù)
3#
cokeboL
歡迎光臨 Chinaunix (http://www.72891.cn/)
Powered by Discuz! X3.2