recently, in one of my ndk projects, there are garbled codes caused by inconsistent coding in the process of data transmission (I develop the client, but the server is not in charge of it), so I intend to use iconv.h for conversion, but prompt
./gui/renderware_imgui.cpp:116:15: error: use of undeclared identifier "iconv_open"
iconv_t cd = iconv_open(to_charset, source_charset);
^
./gui/renderware_imgui.cpp:128:6: error: use of undeclared identifier "iconv"
if (iconv(cd, &inbuf, &inlen, &poutbuf,&outlen) == -1)
^
./gui/renderware_imgui.cpp:132:2: error: use of undeclared identifier "iconv_close"
then I opened the iconv.h, of NDK r17b and found this
-sharpif __ANDROID_API__ >= 28
iconv_t iconv_open(const char* __src_encoding, const char* __dst_encoding) __INTRODUCED_IN(28);
size_t iconv(iconv_t __converter, char** __src_buf, size_t* __src_bytes_left, char** __dst_buf, size_t* __dst_bytes_left) __INTRODUCED_IN(28);
int iconv_close(iconv_t __converter) __INTRODUCED_IN(28);
-sharpendif /* __ANDROID_API__ >= 28 */
my project sdk api is 14 and he asked for 28 (Android 9), but I can"t ask and can"t let all users use Android 9, how to solve it?
NDK:r17b
SDK API:28