想要实现编码转换,然而编译错误 undefined reference to `iconv_open'

chenqing_lang
Posts: 1
Joined: Fri Mar 27, 2020 8:45 am

想要实现编码转换,然而编译错误 undefined reference to `iconv_open'

Postby chenqing_lang » Fri Mar 27, 2020 8:51 am

1585298867(1).png
编译结果
1585298867(1).png (121.18 KiB) Viewed 5355 times
我自己代码中已经写好#include <iconv.h>的了

Code: Select all

#include "include.h"

#include <iconv.h>

extern struct demoksApi demoks;

void System_SleepLoop(void)
{                                                                   
    unsigned char key;
    char string[32];
    

    Gpio_init();
    
    OLED_Init();
    OLED_DispStr16(0,0,"Startup..",0);
    OLED_DispStr16(0,2,"启动..",0);

    printf("启动..\r\n");
    
    
    iconv_t cd;

    iconv_open("gb2312","utf-8");

    printf("iconv_open()\r\n");

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: 想要实现编码转换,然而编译错误 undefined reference to `iconv_open'

Postby ESP_Gargamel » Sat Mar 28, 2020 1:02 pm

esp-idf 中没有对 iconv 的支持,需要自行移植如 libiconv。

Who is online

Users browsing this forum: No registered users and 45 guests