error: passing ‘const AppJniCommand’ as ‘this’ argument discards qualifiers [-fpermissive]

简介: error: passing ‘const AppJniCommand’ as ‘this’ argument discards qualifiers [-fpermissive]

具体错误:


proxy_jni_function.cpp:199:55: error: passing ‘const AppJniCommand’ as ‘this’ argument discards qualifiers [-fpermissive]
  199 |     jbyte* jdata = pJniCommand->jstringToJbyte(jresult);
      |                                                       ^

错误是奇怪的,原因是简单的,就是多了个const:


static void jstringToJson(jstring jresult, const AppJniCommand* pJniCommand)
{
    jbyte* jdata = pJniCommand->jstringToJbyte(jresult);
}

改成:


static void jstringToJson(jstring jresult, AppJniCommand* pJniCommand)
目录
相关文章
|
4月前
|
开发者 Python
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
612 0
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
|
4月前
|
Python
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
298 0
|
4月前
|
机器学习/深度学习 Python
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
141 0
|
4月前
|
安全
Warning: Don’t paste code into the DevTools Console that you don’t understand or haven’t reviewed yo
Warning: Don’t paste code into the DevTools Console that you don’t understand or haven’t reviewed yo
|
6月前
|
开发工具
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
211 0
报错 ValueError: too many values to unpack (expected 2)
报错 ValueError: too many values to unpack (expected 2)
207 0
ValueError: not enough values to unpack (expected 3, got 2)
这个错误通常是因为在解包(unpacking)元组(tuple)时,元组中的元素数量与期望不符,导致无法将所有元素正确解包。 例如,在以下代码中,元组中只有两个元素,但我们尝试将其解包为三个变量:
619 0
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow
145 0
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
127 0