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)
目录
相关文章
|
5月前
|
开发者 Python
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
【Python】已解决:TypeError: __init__() got an unexpected keyword argument ‘port’
791 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
|
5月前
|
Python
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
352 0
|
5月前
|
机器学习/深度学习 Python
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
【Python】已解决TypeError: init() got an unexpected keyword argument ‘threshold’
233 0
Invalid mapping pattern detected: /download/{{fileName}} ^Not allowed to nest variable c
Invalid mapping pattern detected: /download/{{fileName}} ^Not allowed to nest variable c
|
5月前
|
安全
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
|
7月前
|
开发工具
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
222 0
报错 ValueError: too many values to unpack (expected 2)
报错 ValueError: too many values to unpack (expected 2)
218 0
ValueError: not enough values to unpack (expected 3, got 2)
这个错误通常是因为在解包(unpacking)元组(tuple)时,元组中的元素数量与期望不符,导致无法将所有元素正确解包。 例如,在以下代码中,元组中只有两个元素,但我们尝试将其解包为三个变量:
653 0
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
130 0
下一篇
DataWorks