解决办法: error: passing ‘const VideoFrame’ as ‘this’ argument discards qualifiers [-fpermissive]

简介: 解决办法: error: passing ‘const VideoFrame’ as ‘this’ argument discards qualifiers [-fpermissive]

有以下错误:


void process(const VideoFrame* pFrame)
{
    pFrame->saveToJpeg();
}

编译时出错:

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

 原因是参数作为const。修改如下即可:


((VideoFrame*)pFrame)->saveToJpeg();

目录
相关文章
|
3月前
|
Python
完美解决丨File “invalid.py“, line 1 print(`Hello World!`) ^ SyntaxError: invalid syntax
完美解决丨File “invalid.py“, line 1 print(`Hello World!`) ^ SyntaxError: invalid syntax
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
|
4月前
|
开发工具
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
65 0
|
11月前
Multiple substitutions specified in non-positional format; did you mean to add BUG(7)
Multiple substitutions specified in non-positional format; did you mean to add BUG(7)
|
11月前
报错 ValueError: too many values to unpack (expected 2)
报错 ValueError: too many values to unpack (expected 2)
147 0
|
JSON 数据格式
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
遇到【Unexpected character (‘“‘ (code 34)): was expecting comma to separate Object entries】的解决办法
error: passing ‘const AppJniCommand’ as ‘this’ argument discards qualifiers [-fpermissive]
error: passing ‘const AppJniCommand’ as ‘this’ argument discards qualifiers [-fpermissive]
69 0
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
95 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
110 0
|
C语言
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
111 0