conflicting types for 'timer_t' 的解决

本文介绍在Slackware12.1-Xfce4.4.2环境下安装电池监视器插件时遇到的编译错误及解决方案。通过调整头文件包含顺序解决了类型冲突问题。
编译程序时遇到conflicting types for 'timer_t'  问题的的解决

http://goodies.xfce.org/提供了许多Xfce环境下的插件,其中有个电池监视器插件,按照安装说明中的步骤编译时出现如下错误:

In  file included from . / libapm.h: 21 ,
                 from battery.c:
39 :
/ usr / include / sys / types.h: 62 : error: conflicting types  for  'dev_t'
/ usr / include / linux / types.h: 19 : error: previous declaration of 'dev_t' was here
/ usr / include / sys / types.h: 67 : error: conflicting types  for  'gid_t'
/ usr / include / linux / types.h: 53 : error: previous declaration of 'gid_t' was here
/ usr / include / sys / types.h: 72 : error: conflicting types  for  'mode_t'
/ usr / include / linux / types.h: 21 : error: previous declaration of 'mode_t' was here
/ usr / include / sys / types.h: 77 : error: conflicting types  for  'nlink_t'
/ usr / include / linux / types.h: 22 : error: previous declaration of 'nlink_t' was here
/ usr / include / sys / types.h: 82 : error: conflicting types  for  'uid_t'
/ usr / include / linux / types.h: 52 : error: previous declaration of 'uid_t' was here
In  file included from  / usr / include / sys / types.h: 133 ,
                 from .
/ libapm.h: 21 ,
                 from battery.c:
39 :
/ usr / include / time.h: 105 : error: conflicting types  for  'timer_t'
/ usr / include / linux / types.h: 28 : error: previous declaration of 'timer_t' was here
In  file included from  / usr / include / sys / types.h: 220 ,
                 from .
/ libapm.h: 21 ,
                 from battery.c:
39 :
/ usr / include / sys / select.h: 78 : error: conflicting types  for  'fd_set'
/ usr / include / linux / types.h: 18 : error: previous declaration of 'fd_set' was here
In  file included from . / libapm.h: 21 ,
                 from battery.c:
39 :
/ usr / include / sys / types.h: 235 : error: conflicting types  for  'blkcnt_t'
/ usr / include / linux / types.h: 151 : error: previous declaration of 'blkcnt_t' was here
make[
2 ]:  ***  [xfce4_battery_plugin - battery.o] Error  1
make[
2 ]: Leaving directory ` / tmp / xfce4 - battery - plugin - 0.5 . 1 / panel - plugin'
make[
1 ]:  ***  [all - recursive] Error  1
make[
1 ]: Leaving directory ` / tmp / xfce4 - battery - plugin - 0.5 . 1 '

make: *** [all] Error 2

 

解决方法:

打开panel-plugin/libapm.h

将如下两行的位置互换

#include <linux/apm_bios.h>

#include <sys/types.h>

变成

#include <sys/types.h>

#include <linux/apm_bios.h>

 

重新编译,通过!

我其实不想向你展示这些报错的,因为感觉会干扰你的设计思路,但是,你看看,你自创就会出现这种问题,给你之后,你有没有获取什么信息nasw.c: In function 'nasw_async_ping_check': nasw.c:185:29: error: storage size of 'diag_timer' isn't known static struct timer diag_timer; ^~~~~~~~~~ nasw.c:186:9: error: implicit declaration of function 'timer_set'; did you mean 'timer_settime'? [-Werror=implicit-function-declaration] timer_set(&diag_timer, diag_timer_callback, NULL, 100); ^~~~~~~~~ timer_settime nasw.c:187:9: error: implicit declaration of function 'timer_add'; did you mean 'inet_addr'? [-Werror=implicit-function-declaration] timer_add(&diag_timer, PERIODIC); ^~~~~~~~~ inet_addr nasw.c:187:32: error: 'PERIODIC' undeclared (first use in this function); did you mean 'EISDIR'? timer_add(&diag_timer, PERIODIC); ^~~~~~~~ EISDIR nasw.c:187:32: note: each undeclared identifier is reported only once for each function it appears in nasw.c:185:29: error: unused variable 'diag_timer' [-Werror=unused-variable] static struct timer diag_timer; ^~~~~~~~~~ nasw.c: At top level: nasw.c:204:24: error: conflicting types for 'nasw_do_ping_check' LOCAL NASW_PING_STATUS nasw_do_ping_check(void) ^~~~~~~~~~~~~~~~~~ nasw.c:63:10: note: previous declaration of 'nasw_do_ping_check' was here LOCAL S8 nasw_do_ping_check(void); ^~~~~~~~~~~~~~~~~~ nasw.c: In function 'nasw_do_ping_check': nasw.c:207:5: error: unknown type name 'sem_t'; did you mean 'key_t'? sem_t diag_sem; ^~~~~ key_t nasw.c:208:5: error: implicit declaration of function 'sem_init'; did you mean 'inet_init'? [-Werror=implicit-function-declaration] sem_init(&diag_sem, 0, 0); ^~~~~~~~ inet_init nasw.c: In function 'callback': nasw.c:213:9: error: implicit declaration of function 'sem_post'; did you mean 'fsetpos'? [-Werror=implicit-function-declaration] sem_post(&diag_sem); ^~~~~~~~ fsetpos nasw.c: In function 'nasw_do_ping_check': nasw.c:224:12: error: implicit declaration of function 'sem_timedwait' [-Werror=implicit-function-declaration] while (sem_timedwait(&diag_sem, &ts) == -1) { ^~~~~~~~~~~~~ nasw.c:230:5: error: implicit declaration of function 'sem_destroy' [-Werror=implicit-function-declaration] sem_destroy(&diag_sem); ^~~~~~~~~~~
10-22
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> #include <string.h> #include "lvgl/lvgl.h" #include "fonts/free_font.h" #include "main_screen.h" #include "asr/asr_offline_sample.h" // 引入ASR头文件 #include "time_manager.h" // 引入时间管理头文件 #include "weather/weather_hour.h" // 添加天气客户端头文件 /* LED控制相关宏定义 */ #define TEST_MAGIC 'x' #define LED_ON 0 #define LED_OFF 1 #define LED1 _IO(TEST_MAGIC, 0) #define LED2 _IO(TEST_MAGIC, 1) #define LED3 _IO(TEST_MAGIC, 2) #define LED4 _IO(TEST_MAGIC, 3) /* 蜂鸣器控制相关宏定义 - 根据测试代码修改 */ #define BEEP_ON 0 #define BEEP_OFF 1 /* 全局状态变量 */ static int led_state = 0; // 0-关闭 1-开启 static int buzzer_state = 0; // 0-关闭 1-开启 static lv_obj_t *asr_status_label = NULL; static lv_obj_t *led_switch_obj = NULL; // 全局LED开关对象 static lv_obj_t *buzzer_switch_obj = NULL; // 全局蜂鸣器开关对象 static lv_obj_t *time_label_func = NULL; // 功能界面时间标签 /* 天气数据显示相关变量 */ static lv_obj_t *today_weather_btn = NULL; static lv_obj_t *weather_img = NULL; static lv_obj_t *weather_city_label = NULL; static lv_obj_t *weather_temp_label = NULL; static lv_obj_t *weather_desc_label = NULL; static lv_obj_t *weather_humidity_label = NULL; static lv_obj_t *weather_wind_label = NULL; /* 函数声明 */ static void led_switch_event_handler(lv_event_t *e); static void buzzer_switch_event_handler(lv_event_t *e); static void return_to_login_cb(lv_event_t *e); static void update_asr_status_timer_cb(lv_timer_t *timer); static void weather_data_callback(const char* data); static void create_weather_display(lv_obj_t *parent); void led_control(int state); void buzzer_control(int state); void update_led_switch_state(int state); void update_buzzer_switch_state(int state); /* LED开关事件回调 */ static void led_switch_event_handler(lv_event_t *e) { lv_obj_t *switch_obj = lv_event_get_target(e); led_state = lv_obj_has_state(switch_obj, LV_STATE_CHECKED) ? 1 : 0; led_control(led_state); } /* 蜂鸣器开关事件回调 */ static void buzzer_switch_event_handler(lv_event_t *e) { lv_obj_t *switch_obj = lv_event_get_target(e); buzzer_state = lv_obj_has_state(switch_obj, LV_STATE_CHECKED) ? 1 : 0; buzzer_control(buzzer_state); } /* 返回登录界面的回调函数 */ static void return_to_login_cb(lv_event_t *e); // 定时器回调函数,用于更新语音识别状态显示 static void update_asr_status_timer_cb(lv_timer_t *timer) { lv_obj_t *label = (lv_obj_t *)timer->user_data; if (led_state) { lv_label_set_text(label, ""); } else { lv_label_set_text(label, ""); } lv_timer_del(timer); // 只执行一次 } /* LED控制函数 */ void led_control(int state) { printf("LED控制调用: 状态=%d\n", state); int fd = open("/dev/Led", O_RDWR); if(fd == -1) { perror("open:/dev/Led"); return; } if(state == 1) { ioctl(fd, LED1, LED_ON); ioctl(fd, LED2, LED_ON); ioctl(fd, LED3, LED_ON); ioctl(fd, LED4, LED_ON); printf("所有LED灯亮\n"); // 更新界面显示 if (asr_status_label) { lv_label_set_text(asr_status_label, ""); } // 更新开关状态 update_led_switch_state(1); } else if(state == 0) { ioctl(fd, LED1, LED_OFF); ioctl(fd, LED2, LED_OFF); ioctl(fd, LED3, LED_OFF); ioctl(fd, LED4, LED_OFF); printf("所有LED灯灭\n"); // 更新界面显示 if (asr_status_label) { lv_label_set_text(asr_status_label, ""); } // 更新开关状态 update_led_switch_state(0); } close(fd); } /* 蜂鸣器控制函数 - 根据测试代码修改 */ void buzzer_control(int state) { printf("蜂鸣器控制调用: 状态=%d\n", state); int fd = open("/dev/beep", O_RDWR); if(fd == -1) { perror("open:/dev/beep"); printf("尝试其他可能的设备名...\n"); // 如果蜂鸣器设备不存在,尝试其他可能的设备名 fd = open("/dev/Beep", O_RDWR); if(fd == -1) { perror("open:/dev/Beep"); return; } } if(state == 1) { // 根据测试代码,第二个参数是命令,第三个参数是值 ioctl(fd, BEEP_ON, 1); printf("蜂鸣器开启\n"); // 更新开关状态 update_buzzer_switch_state(1); } else if(state == 0) { // 根据测试代码,第二个参数是命令,第三个参数是值 ioctl(fd, BEEP_OFF, 1); printf("蜂鸣器关闭\n"); // 更新开关状态 update_buzzer_switch_state(0); } close(fd); } /* 更新LED开关状态函数 */ void update_led_switch_state(int state) { if (led_switch_obj == NULL) { printf("LED开关对象未初始化\n"); return; } if (state == 1) { // 打开开关 lv_obj_add_state(led_switch_obj, LV_STATE_CHECKED); printf("界面LED开关状态已更新: 打开\n"); } else { // 关闭开关 lv_obj_clear_state(led_switch_obj, LV_STATE_CHECKED); printf("界面LED开关状态已更新: 关闭\n"); } // 更新全局LED状态 led_state = state; } /* 更新蜂鸣器开关状态函数 */ void update_buzzer_switch_state(int state) { if (buzzer_switch_obj == NULL) { printf("蜂鸣器开关对象未初始化\n"); return; } if (state == 1) { // 打开开关 lv_obj_add_state(buzzer_switch_obj, LV_STATE_CHECKED); printf("界面蜂鸣器开关状态已更新: 打开\n"); } else { // 关闭开关 lv_obj_clear_state(buzzer_switch_obj, LV_STATE_CHECKED); printf("界面蜂鸣器开关状态已更新: 关闭\n"); } // 更新全局蜂鸣器状态 buzzer_state = state; } /* 天气数据回调函数 */ static void weather_data_callback(const char* data) { printf("收到天气数据回调: %s\n", data); update_weather_display(data); } /* 解析天气数据并更新显示 */ void update_weather_display(const char* weather_data) { if (today_weather_btn == NULL) { printf("天气按钮未初始化,无法更新天气显示\n"); return; } printf("正在解析天气数据: %s\n", weather_data); // 解析天气数据(假设格式为:城市|温度|天气描述|湿度|风速) char city[50] = "未知城市"; char temp[20] = "--°C"; char desc[50] = "未知天气"; char humidity[20] = "湿度: --%"; char wind[30] = "风速: --m/s"; // 简单的解析逻辑,根据实际数据格式调整 char data_copy[512]; strncpy(data_copy, weather_data, sizeof(data_copy)-1); data_copy[sizeof(data_copy)-1] = '\0'; char *token = strtok(data_copy, "|"); if (token) { strncpy(city, token, sizeof(city)-1); city[sizeof(city)-1] = '\0'; token = strtok(NULL, "|"); if (token) { strncpy(temp, token, sizeof(temp)-1); temp[sizeof(temp)-1] = '\0'; token = strtok(NULL, "|"); if (token) { strncpy(desc, token, sizeof(desc)-1); desc[sizeof(desc)-1] = '\0'; token = strtok(NULL, "|"); if (token) { snprintf(humidity, sizeof(humidity), "湿度: %s%%", token); token = strtok(NULL, "|"); if (token) { snprintf(wind, sizeof(wind), "风速: %sm/s", token); } } } } } // 更新天气显示 if (weather_city_label) { lv_label_set_text(weather_city_label, city); } if (weather_temp_label) { lv_label_set_text(weather_temp_label, temp); } if (weather_desc_label) { lv_label_set_text(weather_desc_label, desc); } if (weather_humidity_label) { lv_label_set_text(weather_humidity_label, humidity); } if (weather_wind_label) { lv_label_set_text(weather_wind_label, wind); } printf("天气显示已更新: %s %s %s %s %s\n", city, temp, desc, humidity, wind); } /* 创建天气显示组件 */ static void create_weather_display(lv_obj_t *parent) { // 创建天气图片 weather_img = lv_img_create(parent); lv_img_set_src(weather_img, "A:/imgs/today.png"); lv_obj_set_size(weather_img, 300, 380); lv_obj_align(weather_img, LV_ALIGN_CENTER, 0, 0); lv_obj_set_style_radius(weather_img, 20, 0); lv_obj_set_style_clip_corner(weather_img, true, 0); // 创建城市名称标签 weather_city_label = lv_label_create(parent); lv_label_set_text(weather_city_label, "加载中..."); lv_obj_add_style(weather_city_label, FontStyleInit(), 0); lv_obj_set_style_text_color(weather_city_label, lv_color_hex(0x000000), 0); lv_obj_align(weather_city_label, LV_ALIGN_TOP_MID, 0, 30); // 创建温度标签 weather_temp_label = lv_label_create(parent); lv_label_set_text(weather_temp_label, "--°C"); lv_obj_add_style(weather_temp_label, FontStyleInit3(), 0); lv_obj_set_style_text_color(weather_temp_label, lv_color_hex(0xFF4500), 0); lv_obj_align(weather_temp_label, LV_ALIGN_CENTER, 0, -40); // 创建天气描述标签 weather_desc_label = lv_label_create(parent); lv_label_set_text(weather_desc_label, "未知天气"); lv_obj_add_style(weather_desc_label, FontStyleInit(), 0); lv_obj_set_style_text_color(weather_desc_label, lv_color_hex(0x000000), 0); lv_obj_align(weather_desc_label, LV_ALIGN_CENTER, 0, 0); // 创建湿度标签 weather_humidity_label = lv_label_create(parent); lv_label_set_text(weather_humidity_label, "湿度: --%"); lv_obj_add_style(weather_humidity_label, FontStyleInit(), 0); lv_obj_set_style_text_color(weather_humidity_label, lv_color_hex(0x000000), 0); lv_obj_align(weather_humidity_label, LV_ALIGN_CENTER, 0, 40); // 创建风速标签 weather_wind_label = lv_label_create(parent); lv_label_set_text(weather_wind_label, "风速: --m/s"); lv_obj_add_style(weather_wind_label, FontStyleInit(), 0); lv_obj_set_style_text_color(weather_wind_label, lv_color_hex(0x000000), 0); lv_obj_align(weather_wind_label, LV_ALIGN_CENTER, 0, 70); } /* 创建功能界面 */ void function_screen() { // 创建功能界面屏幕 lv_obj_t *func_scr = lv_obj_create(NULL); lv_scr_load(func_scr); // 功能界面背景 lv_obj_t *bg = lv_img_create(func_scr); lv_img_set_src(bg, "A:/imgs/weather_bg2.png"); lv_obj_set_size(bg, 800, 480); // 时间显示标签 - 右上角 time_label_func = lv_label_create(func_scr); lv_label_set_text(time_label_func, get_current_time_string()); lv_obj_add_style(time_label_func, FontStyleInit(), 0); lv_obj_set_style_text_color(time_label_func, lv_color_hex(0x000000), 0); lv_obj_align(time_label_func, LV_ALIGN_TOP_RIGHT, -20, 20); // 设置功能界面时间标签 set_func_time_label(time_label_func); // 语音识别状态提示 asr_status_label = lv_label_create(func_scr); lv_label_set_text(asr_status_label, ""); lv_obj_add_style(asr_status_label, FontStyleInit(), 0); lv_obj_set_style_text_color(asr_status_label, lv_color_hex(0x000000), 0); lv_obj_align(asr_status_label, LV_ALIGN_CENTER, 0, -60); // LED控制标签 lv_obj_t *led_label = lv_label_create(func_scr); lv_label_set_text(led_label, "LED控制"); lv_obj_add_style(led_label, FontStyleInit(), 0); lv_obj_set_style_text_color(led_label, lv_color_hex(0x000000), 0); lv_obj_align(led_label, LV_ALIGN_CENTER, -100, 60); // 创建LED开关 led_switch_obj = lv_switch_create(func_scr); // 赋值给全局变量 lv_obj_align(led_switch_obj, LV_ALIGN_CENTER, -100, 90); lv_obj_add_event_cb(led_switch_obj, led_switch_event_handler, LV_EVENT_VALUE_CHANGED, NULL); lv_obj_set_style_bg_color(led_switch_obj, lv_color_hex(0x666666), LV_STATE_DEFAULT); lv_obj_set_style_bg_color(led_switch_obj, lv_color_hex(0x00BB00), LV_STATE_CHECKED); // 蜂鸣器控制标签 lv_obj_t *buzzer_label = lv_label_create(func_scr); lv_label_set_text(buzzer_label, "蜂鸣器控制"); lv_obj_add_style(buzzer_label, FontStyleInit(), 0); lv_obj_set_style_text_color(buzzer_label, lv_color_hex(0x000000), 0); lv_obj_align(buzzer_label, LV_ALIGN_CENTER, 100, 60); // 创建蜂鸣器开关 buzzer_switch_obj = lv_switch_create(func_scr); // 赋值给全局变量 lv_obj_align(buzzer_switch_obj, LV_ALIGN_CENTER, 100, 90); lv_obj_add_event_cb(buzzer_switch_obj, buzzer_switch_event_handler, LV_EVENT_VALUE_CHANGED, NULL); lv_obj_set_style_bg_color(buzzer_switch_obj, lv_color_hex(0x666666), LV_STATE_DEFAULT); lv_obj_set_style_bg_color(buzzer_switch_obj, lv_color_hex(0x00BB00), LV_STATE_CHECKED); // 根据当前状态设置开关初始状态 if (led_state == 1) { lv_obj_add_state(led_switch_obj, LV_STATE_CHECKED); } else { lv_obj_clear_state(led_switch_obj, LV_STATE_CHECKED); } if (buzzer_state == 1) { lv_obj_add_state(buzzer_switch_obj, LV_STATE_CHECKED); } else { lv_obj_clear_state(buzzer_switch_obj, LV_STATE_CHECKED); } // 返回登录界面按钮 lv_obj_t *return_btn = lv_btn_create(func_scr); lv_obj_set_size(return_btn, 150, 50); lv_obj_align(return_btn, LV_ALIGN_BOTTOM_MID, 0, -30); lv_obj_set_style_radius(return_btn, 10, 0); lv_obj_t *return_label = lv_label_create(return_btn); lv_label_set_text(return_label, "返回登录"); lv_obj_center(return_label); lv_obj_add_style(return_label, FontStyleInit(), 0); // 添加返回事件处理 lv_obj_add_event_cb(return_btn, return_to_login_cb, LV_EVENT_CLICKED, NULL); // 创建天气显示按钮 today_weather_btn = lv_btn_create(func_scr); lv_obj_set_pos(today_weather_btn, 20, 20); lv_obj_set_size(today_weather_btn, 300, 380); lv_obj_set_style_radius(today_weather_btn, 20, 0); lv_obj_set_style_bg_color(today_weather_btn, lv_color_white(), 0); lv_obj_set_style_bg_opa(today_weather_btn, LV_OPA_COVER, 0); // 创建天气显示组件 create_weather_display(today_weather_btn); printf("检查语音识别文件...\n"); if (access("/usrCode/asr/common.jet", F_OK) != 0) { printf("警告: 语音识别资源文件不存在\n"); lv_label_set_text(asr_status_label, ""); } else if (access("/usrCode/asr/call.bnf", F_OK) != 0) { printf("警告: 语法文件不存在\n"); lv_label_set_text(asr_status_label, ""); } else if (access("/usrCode/asr/GrmBuild", F_OK) != 0) { printf("创建语法构建目录\n"); system("mkdir -p /usrCode/asr/GrmBuild"); } else { printf("语音识别文件检查通过\n"); } // 检查录音设备 if (access("/dev/dsp", F_OK) != 0 && access("/dev/audio", F_OK) != 0) { printf("警告: 未找到录音设备\n"); lv_label_set_text(asr_status_label, ""); } else { printf("录音设备检查通过\n"); // 启动语音识别功能 start_asr(); // 延迟更新状态显示(2秒后) lv_timer_create(update_asr_status_timer_cb, 2000, asr_status_label); } // 初始化天气客户端 printf("初始化天气客户端...\n"); if (weather_client_init(weather_data_callback) == 0) { printf("天气客户端初始化成功\n"); // 发送初始天气请求 lv_timer_t *weather_timer = lv_timer_create([](lv_timer_t *timer) { send_weather_request("get_weather"); lv_timer_del(timer); }, 1000, NULL); } else { printf("天气客户端初始化失败\n"); // 显示默认天气信息 update_weather_display("北京|25°C|晴|45|3.2"); } } /* 返回登录界面的回调函数 */ static void return_to_login_cb(lv_event_t *e) { // 停止语音识别 stop_asr(); // 关闭天气客户端 weather_client_close(); // 关闭LED灯和蜂鸣器再返回登录界面 led_control(0); buzzer_control(0); led_state = 0; buzzer_state = 0; // 重置开关对象指针 led_switch_obj = NULL; buzzer_switch_obj = NULL; // 清理天气显示对象 today_weather_btn = NULL; weather_img = NULL; weather_city_label = NULL; weather_temp_label = NULL; weather_desc_label = NULL; weather_humidity_label = NULL; weather_wind_label = NULL; // 清理时间标签引用 cleanup_time_labels(); // 显示登录界面 show_login_screen(); } /* 清理功能界面资源 */ void cleanup_function_screen() { // 停止语音识别 stop_asr(); // 关闭天气客户端 weather_client_close(); // 清理时关闭LED和蜂鸣器 led_control(0); buzzer_control(0); led_state = 0; buzzer_state = 0; // 重置开关对象指针 led_switch_obj = NULL; buzzer_switch_obj = NULL; // 清理天气显示对象 today_weather_btn = NULL; weather_img = NULL; weather_city_label = NULL; weather_temp_label = NULL; weather_desc_label = NULL; weather_humidity_label = NULL; weather_wind_label = NULL; // 清理时间标签引用 cleanup_time_labels(); } 修改报错代码:luo@virtual:/mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master$ make -j64 /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c: In function ‘weather_data_callback’: /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c:213:5: warning: implicit declaration of function ‘update_weather_display’ [-Wimplicit-function-declaration] update_weather_display(data); ^ /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c: At top level: /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c:217:6: warning: conflicting types for ‘update_weather_display’ void update_weather_display(const char* weather_data) { ^ /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c:213:5: note: previous implicit declaration of ‘update_weather_display’ was here update_weather_display(data); ^ /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c: In function ‘function_screen’: /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c:461:53: error: expected expression before ‘[’ token lv_timer_t *weather_timer = lv_timer_create([](lv_timer_t *timer) { ^ /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c:461:75: error: expected ‘)’ before ‘{’ token lv_timer_t *weather_timer = lv_timer_create([](lv_timer_t *timer) { ^ /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c:461:37: error: too few arguments to function ‘lv_timer_create’ lv_timer_t *weather_timer = lv_timer_create([](lv_timer_t *timer) { ^ In file included from /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/lvgl/lvgl.h:26:0, from /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c:7: /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/lvgl/src/misc/lv_timer.h:106:14: note: declared here lv_timer_t * lv_timer_create(lv_timer_cb_t timer_xcb, uint32_t period, void * u ^ /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.c:461:21: warning: unused variable ‘weather_timer’ [-Wunused-variable] lv_timer_t *weather_timer = lv_timer_create([](lv_timer_t *timer) { ^ make: *** [Makefile:47: /mnt/hgfs/lv_code/lv_port_linux_frame_buffer-master/usrCode/func_screen.o] Error 1
最新发布
11-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值